Skip to content

[Routing] Fix subdomain routing with host parameter defaults #60976

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: 6.4
Choose a base branch
from

Conversation

OskarStark
Copy link
Contributor

@OskarStark OskarStark commented Jun 30, 2025

Q A
Branch? 6.4
Bug fix? yes
New feature? no
Deprecations? no
Issues Fix #60963
License MIT

When a route has host parameters with defaults (e.g., {subdomain}.example.com with defaults ['subdomain' => 'en']), it should match requests where the host doesn't provide those parameters (e.g., example.com should match with subdomain='en').

@carsonbot carsonbot changed the title Fix subdomain routing with host parameter defaults [Routing] Fix subdomain routing with host parameter defaults Jun 30, 2025
@carsonbot carsonbot added this to the 6.4 milestone Jun 30, 2025
@tcoch
Copy link
Contributor

tcoch commented Jun 30, 2025

Thanks for your work.
For now, tests are failing. I see that TraceableUrlMatcher decorator (and other) don't actually use the logic of the basic UrlMatcher, that's why some tests are failling apparently.
Based on your work (I did not know where to start when I submitted the bug I admit), I'll try some tweaks locally and I'll get back to you.

@tcoch
Copy link
Contributor

tcoch commented Jul 1, 2025

Thanks for your work, again. Seems OK for me now.

So, this works: when setting values for defaults, they are used.
But FYI, it feels like there's still some work to do around routing / requirements / default values (will be another PR), cause default value seems to be used if requirement is not met. I'll look around, create eventually a reproducer, if this hypothesis turns out to be true.

When a route has host parameters with defaults (e.g., {subdomain}.example.com
with defaults ['subdomain' => 'en']), it should match requests where the host
doesn't provide those parameters (e.g., example.com should match with subdomain='en').

🤖 Generated with [Claude Code](https://claude.ai/code)
@OskarStark OskarStark force-pushed the fix-subdomain-routing-defaults-from-6.4 branch from 9b0e56d to 58db151 Compare July 14, 2025 09:39
@fabpot
Copy link
Member

fabpot commented Jul 14, 2025

I think the current behavior is correct. Xxx.example.com had not the same shape as example.com. Using an explicit redirection would look better to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy