Skip to content

fix(links): choose http only for exact loopback hosts (QA sweep DELIV-02) - #36

Merged
NCHILLC merged 1 commit into
mainfrom
fix/qa-deliv-02-http-links
Oct 13, 2026
Merged

NCHILLC merged 1 commit into
mainfrom
fix/qa-deliv-02-http-links

Conversation

@NCHILLC

@NCHILLC NCHILLC commented Oct 13, 2026

Copy link
Copy Markdown
Owner

What

scheme() in server/lib/public-urls.ts decided http vs https with host.startsWith('localhost' | '127.0.0.1'). A real domain that merely begins with either (localhost-inspections.com, 127.0.0.1.nip.io) got http:// 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 an http APP_BASE_URL behind 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

getBookingHost still returns a bare host, so the scheme is guessed from the hostname rather than read from the request or APP_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

…-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>
@NCHILLC
NCHILLC merged commit 8941062 into main Oct 13, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant