2017-09-24 12 views
0

に設定してください。 は、私は私のヘッダの許可=ActionFilterAttribute .net core WebApi。カスタムレスポンスヘッダーを

enter image description here

結果、デバッグ、headers.Add ヘッダ、未知のヘッダーを変更し、JavaScriptでそれを取得したい

enter image description here

私はJavaScriptでそれを得ることができません、彼はヘッダーを送信しなかったので、ヘッダーを送信する方法?解決

.NETのコアウェブAPI 2.0

答えて

0

solved! // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 
    public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) 
    { 
     app.UseMiddleware(typeof(ErrorHandlingMiddleware)); 
     app.UseCors(b => b.AllowAnyHeader().WithExposedHeaders("Authorization").AllowAnyMethod().AllowAnyOrigin().AllowCredentials()); 
     app.UseMvc(); 

    } 

.WithExposedHeaders( "認可" を)

THX

を追加
関連する問題