user5738822
user5738822

Reputation:

angular 2 Response for preflight has invalid HTTP status code 401 error

I trying to create a application with angular 2,and have authentication service, when I request to my server get this error:

Response for preflight has invalid HTTP status code 401

when I use postman everything is ok but use xhrrequest throw this error, what is my problem?

Upvotes: 1

Views: 9416

Answers (1)

Thierry Templier
Thierry Templier

Reputation: 202148

The problem could be that credentials aren't sent for preflighted requests (OPTIONS one) so your server application shouln't check security at this level only for the target request.

But it's an issue on your server side...

This article could interest you:

Upvotes: 2

Related Questions