Skip to content

fix(redirectd): serve www.<apex> from the apex registration#12

Merged
pstaylor-patrick merged 1 commit into
mainfrom
fix/www-inherits-apex
May 24, 2026
Merged

fix(redirectd): serve www.<apex> from the apex registration#12
pstaylor-patrick merged 1 commit into
mainfrom
fix/www-inherits-apex

Conversation

@pstaylor-patrick

Copy link
Copy Markdown
Collaborator

What this PR does

Makes the "recommended www CNAME" honest. The dashboard tells users to add www.<domain> CNAME → apex "so www redirects too", but the redirect tier only served exact-match hosts — so www.<apex> failed TLS (the on-demand gate refused a cert for an unregistered host) even with the CNAME in place.

Config.Resolve now falls back to the www-stripped host: registering f3muletown.com also serves www.f3muletown.com (same target). Because IsRegistered flows through Resolve, the on-demand TLS gate issues the www cert too. An explicit www mapping still takes precedence.

Tests

  • TestResolveWWWInheritsApex (TDD): www inherits apex target; www of a registered apex is registered (gate); www of an unregistered host stays unregistered; explicit www mapping wins.
  • Go suite green, vet clean, coverage 77.5%.
  • Verified live: after redeploy, https://www.f3muletown.com → 302 → https://regions.f3nation.com/muletown (cert auto-issued); apex unaffected.

🤖 Generated with Claude Code

…ww CNAME)

The dashboard recommends adding a www CNAME "so www redirects too", but the
redirect tier only served exact-match hosts — so www.<apex> failed TLS (the
on-demand gate refused a cert for an unregistered host) even after the user
added the recommended CNAME.

Config.Resolve now falls back to the www-stripped host: registering
f3muletown.com also serves www.f3muletown.com (same target), and since
IsRegistered flows through Resolve, the on-demand TLS gate issues www's cert
too. An explicit www mapping still wins.

TDD: added TestResolveWWWInheritsApex (inherit target, gate registration,
unregistered www stays unregistered, explicit www precedence). Verified live:
https://www.f3muletown.com now 302s to the apex's destination.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@pstaylor-patrick pstaylor-patrick merged commit 668dd7f into main May 24, 2026
4 checks passed
@pstaylor-patrick pstaylor-patrick deleted the fix/www-inherits-apex branch May 24, 2026 19:33
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