Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Slim 4 - CORS with preflight request
@cnakamoto

This comment has been minimized.

Copy link

cnakamoto commented Apr 30, 2020

I spent a lot of time trying to get CORS working with the Slim 4 skeleton app until I discovered the ResponseEmitter class which just lets you add your origin host and takes care of the rest. FYI for anyone else in this situation.

@luisaureliocasoni

This comment has been minimized.

Copy link

luisaureliocasoni commented May 18, 2020

One thing about preflight requests is: when the preflight request is causing error, check if Authorization Middleware is authenticating OPTIONS routes.

If OPTION route is authenticated, causes on non 2xx requests, making the browser abort the request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.