fix(feedback-site): keep every link and redirect under the /feedback/ prefix #592
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/feedback-mockup-links"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up to #590, part of #363. Reported on first real use: the round-two mockup links sent people to the Quest Board login page.
Cause. The site is served at
/feedback/behind Caddy'shandle_path, which strips the prefix before the request reaches the app. The landing page linked its designs as/mockups/aand/mockups/b, so a click left the site and landed in the Quest Board app, which sends a signed-out reader to its login page. The page's script already derived the correct prefix for saving answers; it just never applied it to the two links.A second route to the same place. Starlette's
redirect_slashesbuilds itsLocationfrom the path it sees, which has already lost/feedback, so/feedback/mockups/was redirected to/mockups. Anyone whose chat app or browser appended a slash would have hit the same login page.Fix.
hrefs are relative fallbacks. The index page's three card links get relative fallbacks too; its script was already rescuing them.redirect_slashesis off, and a trailing slash on a GET or HEAD is answered with a relativeLocation(/mockups/a/→../a), which the browser resolves against the URL it actually requested. The share key survives the redirect.Why the tests missed it, and what closes that. Every route test passed throughout, because a test client requests known paths directly and never follows a link a person clicks.
tests/test_static_links.pyasserts that no page carries a root-relativehref,srcoraction, and that trailing slashes redirect relatively with the query intact. Both sets failed against the broken code (2 and 6 failures) before passing; the suite is 34 of 34.Already deployed to dev and verified through the public URL: every trailing-slash variant now resolves inside
/feedback/, and the three round-one responses are untouched.🤖 Generated with Claude Code