You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to implement CORS processing without any third party libraries (like flask-cors). My desire is simple: assign multiple headers to any response, access and process the pre-flight OPTIONS request.
This discussion was converted from issue #5513 on July 01, 2024 15:51.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I want to implement CORS processing without any third party libraries (like flask-cors). My desire is simple: assign multiple headers to any response, access and process the pre-flight OPTIONS request.
It can be tested like this
With the middleware, it handles a preflight OPTIONS request as an original one:
But the desired behaviour should be like that (you can comment middleware registration and uncomment logic in the view-handler):
Also, I was able to implement desired functionality with the middleware, but with the Werkzeug one:
So, my question is: what could be wrong with the Flask middleware?
Beta Was this translation helpful? Give feedback.
All reactions