access-control-allow-methods is "DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT" while only post defined
See original GitHub issueMy controller:
class BrandController(Controller):
path = '/brand'
@post()
async def create(self, data: BrandNew, edb: AsyncIOClient) -> str:
await edb.query("INSERT Brand { name := <str>$name }", name=data.name)
return 'ok'
On preflight request it returns access-control-allow-methods header equal to “DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT” but only “OPTIONS, POST” should be there.
Issue Analytics
- State:
- Created a year ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Access-Control-Allow-Methods - HTTP - MDN Web Docs
The Access-Control-Allow-Methods response header specifies one or more methods allowed when accessing a resource in response to a preflight ...
Read more >CORSMiddleware not work · Issue #1663 · tiangolo/fastapi
When i use fastapi CORSMiddleware, same as Bram, i receive error when use method POST, so, i change to starlette cors, and works....
Read more >Default value for Access-Control-Allow-Methods
If you allow all HTTP methods, then its ok to set the value to something like Access-Control-Allow-Methods: GET, PUT, POST, DELETE, HEAD ....
Read more >Access-Control-Allow-Methods: Syntax, Directive, Examples
<HEAD> The HEAD method requests for a response identical to a GET request, but with no need for a response body. <POST> The...
Read more >HTTP headers | Access-Control-Allow-Methods - GeeksforGeeks
It is used to indicate which HTTP methods are permitted while accessing the resources ... Access-Control-Allow-Methods: POST, GET, OPTIONS
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Not sure, but I can try.
There is work going in this direction in Starlette https://github.com/encode/starlette/pull/1286, https://github.com/encode/starlette/issues/685, so I think it is better to wait.