Answer the question
In order to leave comments, you need to log in
Why does the OPTIONS method ask for authorization and how to get around it?
The client is written in angular.js.
Services are on a different domain and headers are written in them
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization
Answer the question
In order to leave comments, you need to log in
Preflight request cannot be removed for cross-domain requests. On the server, remove the OPTIONS methods from authorization.
Cross domain request. In .htaccess write:
<ifmodule mod_headers.c>
Header always set Access-Control-Allow-Origin: "*"
Header always set Access-Control-Allow-Methods "POST, GET, PUT, DELETE, OPTIONS"
Header always set Access-Control-Allow-Headers "Content-Type, Authorization, X-Requested-With"
Header always set Access-Control-Allow-Credentials "true"
</ifModule>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question