Serhio g. Lazin
Serhio g. Lazin

Reputation: 9642

Angular 4 HTTP custom headers

In service:

let headers = new HttpHeaders();
     headers = headers.append('sessionToken', token);

in request:

{"normalizedNames":{},"lazyUpdate":[{"name":"sessionToken","value":"22ddc387-dfab-4e03-bbf9-241d75968133","op":"a"}],"headers":{},"lazyInit":{"normalizedNames":{},"lazyUpdate":null,"headers":{}}}

server response:

There are no «sessiontoken» in CORS «Access-Control-Allow-Headers»

Why doesn't it add "sessiontoken" into headers?

Upvotes: 0

Views: 90

Answers (1)

user4676340
user4676340

Reputation:

Because as said in the error,

There are no «sessiontoken» in CORS «Access-Control-Allow-Headers»

Your server must return a response with the header

Access-Control-Allow-Headers = "sessionToken"

Upvotes: 1

Related Questions