Closed AntoninoM90 closed 3 years ago
CORS Pre-Flight route break Slim default behavior. Now you get 405 Method not allowed. Must be one of: OPTIONS
instead of 404 Not found
if no route is matched.
@AntoninoM90 I guess @l0gicgate didn't think about that behaviour which @eugene-borovov explained, you could make a new PR. But I'm also not very sure about this catch either because then you'd get 404 instead of 405 for other routes where you really should get 405. So I think I'd make some checking and open a new PR here and for the docs which checks if it return 404 or 405 depending on if the allowed route is OPTIONS or something else.
There is no need for this. Slim throws HttpNotFoundException if no route is matched when routing has been performed.