fix(redirectd): serve www.<apex> from the apex registration#12
Merged
Conversation
…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>
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 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 — sowww.<apex>failed TLS (the on-demand gate refused a cert for an unregistered host) even with the CNAME in place.Config.Resolvenow falls back to the www-stripped host: registeringf3muletown.comalso serveswww.f3muletown.com(same target). BecauseIsRegisteredflows throughResolve, the on-demand TLS gate issues the www cert too. An explicitwwwmapping 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.https://www.f3muletown.com→ 302 →https://regions.f3nation.com/muletown(cert auto-issued); apex unaffected.🤖 Generated with Claude Code