question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

access-control-allow-methods is "DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT" while only post defined

See original GitHub issue

My 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:closed
  • Created a year ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
slavugancommented, Apr 10, 2022

Not sure, but I can try.

0reactions
slavugancommented, Apr 15, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found