Welcome Guest, Not a member yet? Register   Sign In
Add CORS headers to 404 page
#11

I forgot the reason for the question) The main problem was that when you request /api/some to send a 404 chttpexception in response, there will be an error on the client due to OPTIONS. I expected that 404 would be processed correctly and the client would receive JSON with an error (in fact, it works, only OPTIONS breaks).
Reply
#12

It seems It is because you did not define the route for OPTION method.
Reply
#13

Up)
My routes have OPTIONS. I have stopped working on this, but I may come across it later.

$routes->match(['POST', 'OPTIONS'], 'users/register', 'User::register', ['as' => 'api.user.register']);
Reply




Theme © iAndrew 2016 - Forum software by © MyBB