pallets/flask

Flask subdomain parameter doesn't work at version 2.3.3

GoekhanDev opened this issue · 1 comments

Bug:

Since Flask version 2.3.3 the subdomain parameter when defining a new route doesn't work only with blueprint.

Include a minimal reproducible example that demonstrates the bug:

An example route which will return 404 Not Found even it should:

from flask import Flask

app = Flask(__name__, template_folder='templates', static_folder='static')


@app.route('/logout', subdomain='panel', methods=['POST', 'GET'])
def logout():

    return "ok"


if __name__ == '__main__':
    app.run(host="0.0.0.0", port=80, threaded=True, debug=True)

Describe the expected behavior that should have happened but didn't:
Normally when using the subdomain parameter when defining a new route, the route would've work on that specified subdomain.
With the 2.3.3 version this is only works with Flask Blueprint, the downside of this is that I cannot define multiple subdomains.

Environment:

  • Python version: 3.10.12
  • Flask version: 2.3.3

I think you need to set the SERVER_NAME configuration value, see docs.

I can't reproduce any clear different between 2.3.2 and 2.3.3 - please reopen if you can with a reproducible example.