How to have different allowed methods for different origins in CORSMiddleware? #11794
Unanswered
sohambhardwaj
asked this question in
Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First Check
Commit to Help
Example Code
Description
I want to have different allowed methods for different origins. For example for one url I want "POST" and "GET" methods to be allowed and for other I only want "GET" to be allowed. How can I achieve this?
Will the below approach of writing a custom middleware work?
Operating System
Linux
Operating System Details
No response
FastAPI Version
0.109.2
Pydantic Version
2.8.0
Python Version
Python 3.11.8
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions