79240167

Date: 2024-11-30 17:43:12
Score: 0.5
Natty:
Report link

The solution seems quite simple: subdomain_matching has to be enabled.

app = Flask(__name__, subdomain_matching=True)

The problem IMO is that in this moment Flask documentation is not so clear about this.

In particular the documentation quotes:

SERVER_NAME "Must be set if subdomain_matching is enabled, to be able to extract the subdomain from the request."

but I couldn't find where it explicitly says that since 3.1.0 setting SERVER_NAME alone doesn't activate sudomain_matching anymore.

Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Marco Evasi