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

Ensure the lang-fixup redirects set a Vary header for Accept-Language #14500

Merged
merged 2 commits into from
Apr 25, 2024

Conversation

stevejalim
Copy link
Collaborator

Previously, we relied on similar code deep in lib.l10n_utils.render, but BedrockLangFixupMiddleware runs way before then, so we need(ed) to add the Vary header here, too.

The orginal code in l10n_utils.render still has value, because it handles the fallback for a missing/unactive language to en-US

Issue / Bugzilla link

Resolves #14498

Testing

Check the headers when you go to / and it redirects to /en-US/ (or whatever your browser's local language is)

Previously, we relied on similar code deep in lib.l10n_utils.render,
but BedrockLangFixupMiddleware runs way before then, so we need(ed)
to add the Vary header here, too.

The orginal code in l10n_utils.render still has value, because it
handles the fallback for a missing/unactive language to en-US
Copy link
Member

@robhudson robhudson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔁

Copy link
Member

@pmac pmac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

➡️

…d to upload, dealing with a breaking change in actions/upload-artifact
Copy link

codecov bot commented Apr 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.45%. Comparing base (04576bf) to head (bcb4dbf).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #14500   +/-   ##
=======================================
  Coverage   76.44%   76.45%           
=======================================
  Files         148      148           
  Lines        7978     7980    +2     
=======================================
+ Hits         6099     6101    +2     
  Misses       1879     1879           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@stevejalim stevejalim merged commit 2e45715 into main Apr 25, 2024
5 checks passed
@stevejalim stevejalim deleted the 14498-vary-header-for-redirect branch April 25, 2024 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants