Skip to content
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

Integration-test app throws errors when loading font and SVG files #13940

Open
alexgibson opened this issue Nov 28, 2023 · 3 comments
Open

Integration-test app throws errors when loading font and SVG files #13940

alexgibson opened this issue Nov 28, 2023 · 3 comments
Labels
Bug 🐛 Something's not working the way it should Infra Infrastructure P3 Third level priority - Nice to have

Comments

@alexgibson
Copy link
Member

Description

I noticed our run-integration-tests app doesn't load web fonts or SVG files. Not a huge issue, but it is possible that a test might fail should something like an SVG fail to load somewhere.

Steps to reproduce

https://test.bedrock.nonprod.webservices.mozgcp.net/en-US/firefox/new/

Expected result

Both web fonts and SVG files should load as expected.

Actual result

Fonts get a CSP error:

Content-Security-Policy: The page’s settings blocked the loading of a resource at https://storage.googleapis.com/media/protocol/fonts/Metropolis-Bold.6a80125e795a.woff2 (“font-src”).

SVG files seem to get a 403 when trying to load from https://storage.googleapis.com/

Environment

N/A

@alexgibson alexgibson added Bug 🐛 Something's not working the way it should Infra Infrastructure labels Nov 28, 2023
@alexgibson
Copy link
Member Author

Thinking about it it's probably fine to let the fonts get blocked, but it would be good to make sure images load at least?

@alexgibson alexgibson added the P3 Third level priority - Nice to have label Nov 28, 2023
@janbrasna
Copy link
Contributor

janbrasna commented May 27, 2024

I've elaborated a bit on this here: #9869 (comment)
(fonts CSP fixed, CORS issues for fetch/anon assets, path/host issues when not run in root)

Because even if you allow wildcard origins in dev (or mirror the one from request origin, if you feel like keeping a restricted list of origins to let mirror back in responses), you'd still get prod.bedrock.prod.webservices.mozgcp.net that thinks it's "mozilla.org" (not "allizom.org" or anything else) in integration tests, so it hotlinks all the assets from mozilla.org not *.mozgcp.net because they're output as ://hostname/path not just /path — so not only fonts but also some SVGs (depending on the context how they're loaded, sometimes they're anonymous/fetch) fail CORS too. You can probably relax origin allows for allizom.org, but that won't help the test instances loading assets from mozilla.org 🤷

BTW the weirdest results are for manual pushes to integration tests branch, that run from yet another env test.bedrock.nonprod.webservices.mozgcp.net which links assets from storage.googleapis.com/bedrock-nonprod-test-media (subdirectory) and most of the bedrock code doesn't expect there ever might be a prefix, so a bunch of things is loaded relatively from that, but pointing at root, as /path… trying to load assets from storage.googleapis.com/media/protocol/img/*… etc., so with CORS errors you also get a couple dozen 403s from Goog not liking where we're trying to load stuff from;D I don't know how much of that really matters, just an observation there's more assets broken under different hostnames.

@janbrasna
Copy link
Contributor

FYI there's also CORS issues with staging FxA:

Screen Shot 2024-06-26 at 22 37 43

(never noticed before, but seems consistent now in fxde/chromium§ — can't tell if it's bc of the 401 response or generally unrelated)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🐛 Something's not working the way it should Infra Infrastructure P3 Third level priority - Nice to have
Projects
None yet
Development

No branches or pull requests

2 participants