Repository navigation
fix(links): choose http only for exact loopback hosts (QA sweep DELIV-02) - #36
Merged
Merged
Conversation
…-02) The scheme guess in public-urls matched a host prefix, so a real domain starting with localhost or 127.0.0.1 got http:// on token-bearing links. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
What
scheme()inserver/lib/public-urls.tsdecided http vs https withhost.startsWith('localhost' | '127.0.0.1'). A real domain that merely begins with either (localhost-inspections.com,127.0.0.1.nip.io) gothttp://on token-bearing agreement, invoice and checkout links. It now compares the hostname exactly:localhost,*.localhost,127.0.0.1,[::1].Finding vs cause
The sweep's
http://127.0.0.1:8791/...links were the loopback dev host (http by design) and anhttpAPP_BASE_URLbehind the/v/QR, not a production defect. This PR fixes the one real code defect found while tracing it. No upstream fix exists (grepped).Known ceiling
getBookingHoststill returns a bare host, so the scheme is guessed from the hostname rather than read from the request orAPP_BASE_URL. Recorded in the fork log.Verification
tests/unit/reports/public-urls.spec.ts: new case proven red without the change, green with it.npm run lint:gates-full: 80 of 80.🤖 Generated with Claude Code