-
Notifications
You must be signed in to change notification settings - Fork 508
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
avoid double-slash redirects #3222
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
escattone
approved these changes
Mar 12, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @peterbe!
@@ -78,6 +78,27 @@ exports.handler = async (event) => { | |||
const host = request.headers.host[0].value.toLowerCase(); | |||
const qs = request.querystring ? `?${request.querystring}` : ""; | |||
|
|||
// If the URL was something like `https://domain/en-US/search/`, our code | |||
// would make a that a redirect to `/en-US/search` (stripping the trailing slash). | |||
// But if it was `https://domain/en-US/search/` it'd make a redirect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested change
// But if it was `https://domain/en-US/search/` it'd make a redirect | |
// But if it was `https://domain//en-US/search/` it'd make a redirect |
wbamberg
pushed a commit
to wbamberg/yari
that referenced
this pull request
Mar 15, 2021
* upstream/main: (164 commits) skip empty srcs for safe iframe srcs (mdn#3216) correct code comment (mdn#3223) build(deps): bump ahmadnassri/action-dependabot-auto-merge (mdn#3197) build(deps-dev): bump @types/react-dom from 17.0.1 to 17.0.2 (mdn#3164) create a whatsdeployed.json for translated-content too (mdn#3221) avoid double-slash redirects (mdn#3222) build(deps): bump image-size from 0.9.4 to 0.9.5 (mdn#3214) build(deps): bump boto3 from 1.17.22 to 1.17.26 in /deployer (mdn#3212) Fix our auto-merge workflow (mdn#3218) build(deps-dev): bump ts-loader from 8.0.17 to 8.0.18 (mdn#3208) disable lighthouse PR check unless relevant changes (mdn#3203) hide toolbar for frozen locales (mdn#3213) build(deps): bump is-svg from 4.2.1 to 4.2.2 (mdn#3209) build(deps): bump @mdn/browser-compat-data from 3.1.3 to 3.2.0 (mdn#3210) downloading external images for translated-content (mdn#3207) add active locales (mdn#3201) add tool command for rendering/removing macros (mdn#2955) unsafe html should be a breaking flaw (mdn#3192) open editor for translated content (mdn#3196) add fundamental redirects for /en-US/Security/CSP (mdn#3200) ...
This was referenced Mar 15, 2021
peterbe
added a commit
to peterbe/yari
that referenced
this pull request
Jun 1, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.