Replies: 1 comment 2 replies
-
How is your server configured ? You can use as get,post,put if all are the same remove the if.
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello!
I use AXIOS on your frontend and pass the following headlines:
headers: { 'Authorization': 'Bearer {key}', 'Content-Type': 'application/json' }
In my bekend there is the following answer:
$di->set( 'response', function(){ $response = new Response(); $response ->setHeader("Access-Control-Allow-Origin", '*') ->setHeader("Access-Control-Allow-Methods", 'GET,POST,PUT') ->setHeader("Access-Control-Allow-Headers", '*') ->setHeader("Access-Control-Allow-Credentials", true) ->sendHeaders(); return $response; } );
An error comes in response: No 'Access-Control-Allow-Origin' header is present...
But if you remove the header Authorization, then the answer comes normally.
How to solve this problem?
Beta Was this translation helpful? Give feedback.
All reactions