-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Access-Control-Allow-Origin: * to public XPI files #5875
Comments
Note: like with #5649 it's likely this would need to be done on the ops side |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Since it's an op issue, Rob, do you mind filing a bugzilla bug in |
:wezhou asked whether we should add the header to both AMO and the CDN in the bug. I'd say yes to the CDN, but no for AMO. Adding the header in AMO itself seems to be quite straightforward: Public addons are available on the CDN: When both of the above conditions are true (i.e. the xpi is fully public), then this issue would be fixed by adding the |
Yeah I'll deal with the AMO side in code. |
The CDN should be using whatever header the app returns, which is to say if the app returns that header for addons that satisfy https://github.com/mozilla/addons-server/blob/b0f6f466cd63d3957152ecc6177e36fbe8af99f1/src/olympia/versions/views.py#L88-L91 We can verify if that's the case once the fix lands for the app. |
We redirect to the CDN (or sometimes directly link to it), and it's serving from nginx, bypassing the app completely. Example with ublock origin:
|
Thanks for fixing this @diox! When https://bugzilla.mozilla.org/show_bug.cgi?id=1620084 is fixed and AMO is updated, I can update my crxviewer so that the online version becomes equally fast as the extension version, at least for Firefox addons :) |
Sorry it took so long for something so trivial :) It dropped from my radar and I just caught it because of the stale notification... |
@diox
but I'm not seeing it for this request:
|
@AlexandraMoga that second request will be covered by https://bugzilla.mozilla.org/show_bug.cgi?id=1620084 (it requires ops involvement) |
Describe the problem and steps to reproduce it:
Public XPI files are available at
addons.mozilla.org
and served (via a redirect) fromaddons.cdn.mozilla.net
. Neither of these endpoints include CORS headers in the response.For example, send a HEAD request as follows:
What happened?
Neither response includes the
Access-Control-Allow-Origin: *
header.What did you expect to happen?
Both responses should include the
Access-Control-Allow-Origin: *
header, at least for publicly listed add-ons.Anything else we should know?
I have an add-on to view the source code of extensions: https://github.com/Rob--W/crxviewer
Firefox has started to prevent extensions from sending requests to AMO unless CORS is enabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1450649
To avoid the need for an intermediate proxy, the XPI files have to be served with the
Access-Control-Allow-Origin: *
header.(This is distinct from #5649, which request CORS responses for authenticated API endpoints. I want CORS for XPI files without authentication).
(edit by @diox: add
-H Origin: example.com
to requests in STR)The text was updated successfully, but these errors were encountered: