Would you be open to a patch allowing the use of subdomain routing with no SERVER_NAME pre-configured?
The motivation is to allow multiple domains to match a request, just like it does when SERVER_NAME is None, while still benefiting from the nice subdomain matcher. This is particularly useful in DEV to be able to develop on machine.local but also tunnel the instance to a vpn, and use things like xip.io (which all change the host).
The change would probably be mostly focused on create_url_adapter(). I imagine a configuration variable switching a different logic on for this function: it would look for subdomains and deduce the server_name which is the reverse of what's going on today.
The list of subdomains could come from the configuration I suppose, or better be deduced from the compilation of the routes.
👍 or at least one could provide detailed documentation on the functionality + configuration for this. it ended up being a very costly issue for me on my last major flask project due to the amount of time + debugging it took to get an app with subdomains working stably.
How would that work?
IIRC (it's been a little while now), SERVER_NAME MUST be defined when subdomains are in use or it silently breaks. A patch would change that so that server_name is set from the request, but the list of configured subdomains would be taken into account so they are stripped from it.
I can work on a patch proposal if you like. The easiest would be to read the list of subdomains from the config, but it would be more elegant if it came from the routes, but I have to dig in the code to figure out how to extract that. What do you think?
This led to debating dumping blueprints with my partner