-
-
Notifications
You must be signed in to change notification settings - Fork 16.5k
Closed
Description
Just like this old issue said, routing behavior changed even when subdomain_matching
defaults to false, so take this repository as example, if you comment following lines,
@app.before_request
def start():
"""
init globals and set the schema search path for the current request.
"""
g.user = session.get('user', None)
current_url = urlparse(request.url)
subdomain = current_url.hostname.split('.')
if subdomain.__len__() > 2:
"""
redirect to home page
"""
if current_url.path == "/":
return redirect(url_for('index'))
pass
pass
then requests to user1.flask-subdomain.com
won't route to index
, default 404 as response. Or am I missing something, as a result have misunderstood it. Thanks very much.
@app.route('/')
def index():
return render_template('index.html')
Environment
- Python version: 3.6
- Flask version: 1.1.1
- Werkzeug version: 0.16.0
Metadata
Metadata
Assignees
Labels
No labels