Repository navigation
Site: redirect links with Markdown junk stuck to the end (/**) instead of a 404 - #21
Merged
Merged
Conversation
…d of a 404 Links pasted from chat apps and AI answers often carry "**", ")." or similar after the path. A 404 whose path ends in that junk now 301s to the clean path. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013BvkbbPEvpbYWP2r43ZqnW
Deploying upright with
|
| Latest commit: |
bd6b5ee
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://01efd2c1.upright-2ev.pages.dev |
| Branch Preview URL: | https://claude-project-thread-19gxz5.upright-2ev.pages.dev |
This file contains hidden or 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
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.
Requested by Boss · project thread
Links pasted from chat apps and AI answers often arrive with Markdown or punctuation glued to the end of the URL (
/**,/privacy).), and visitors land on the 404 page.functions/_middleware.js: when the page answer is a 404 and the path ends in* _ ) ] . , ; : ! ' " \>(or their %-encodings), 301 to the path without that tail (/if nothing is left), query kept. Real pages are never redirected (only 404s), and the clean path is served or 404s as usual, so no loops. The CSP nonce step is unchanged./assets/*still skips the Function (_routes.json`).No site test script in this repo. Checked locally with
wrangler pages dev site:/**301/,/privacy**and/privacy).301/privacy,/privacy200 with the nonce CSP,/privacy.html308 (unchanged),/nope404,/llms.txt**301/llms.txt.Generated by Claude Code