Welcome Guest, Not a member yet? Register   Sign In
auto routing (improved), CORS and Authorization header
#1

(This post was last modified: 11-04-2022, 04:27 AM by codeus.)

When sending a POST request (cross-origin) which includes an Authorization HTTP header, the response to OPTIONS request is a 404 - CORS Missing Allow Origin. 
If the Authorization HTTP header is omitted, the request reaches Satellite:postActivate. 
However, when the route is added to Config/Routes.php the request works fine-:


PHP Code:
$routes->options('/satellite/activate''Satellite::postActivate');
$routes->post('/satellite/activate''Satellite::postActivate'); 
I suspect I'm missing something here, but the CORS handling code (Access-Control-Allow-Credentials, Expose-Headers etc) must be OK - the request works, but only if the route is not Auto Routing Improved. Or the Auth header is not used.
Thanks for any response!
Smile
Reply


Messages In This Thread
auto routing (improved), CORS and Authorization header - by codeus - 11-04-2022, 03:04 AM



Theme © iAndrew 2016 - Forum software by © MyBB