0

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?

1 Answer 1

1

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"
Sign up to request clarification or add additional context in comments.

4 Comments

but parameter added into 'lazyUpdate'? headers are empty
No, in your server configuration, the same way you added your CORS headers.
Can you please provide an example?
No I can't. This isn't an Angular issue, that's a server issue. First of all, you should state what back-end you're using, then rephrase your question to ask how to add CORs headers to your server.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.