Skip to content

oauth-server doesn't send CORS headers to requests with no Origin header #2411

@rfk

Description

@rfk

:pauljt and I discovered this while testing the proxy addon. In latest Nightly, CORS requests from a webextension do not include an Origin header. This breaks attempts by webextensions to talk to the oauth-server API, which gives a 404 to the CORS preflight request:

>>> # This works OK
>>> requests.request("OPTIONS", "https://oauth.accounts.firefox.com/v1/token", headers={
  "Origin": "https://example.com",
  "Access-Control-Request-Method": "POST"
})
...
<Response [200]>
>>>
>>> # This gives an error 
>>> requests.request("OPTIONS", "https://oauth.accounts.firefox.com/v1/token", headers={
    "Access-Control-Request-Method": "POST"
})
...
<Response [404]>                                                                                                                                                    >>>

I don't know enough about CORS to know whether this behaviour is expected or desired.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions