Skip to content

Commit

Permalink
Fix subdomain issue with Flask 3.1
Browse files Browse the repository at this point in the history
Flask 3.1 fixed pallets/flask#5553 which had the side-effect of enforcing that subdomain_matching=True must be set.
This is a test case change only.
  • Loading branch information
jwag956 committed Nov 15, 2024
1 parent b41c4f8 commit c6d2b19
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ repos:
- id: check-merge-conflict
- id: fix-byte-order-marker
- repo: https://github.com/asottile/pyupgrade
rev: v3.18.0
rev: v3.19.0
hooks:
- id: pyupgrade
args: [--py39-plus]
Expand All @@ -31,7 +31,7 @@ repos:
- flake8-bugbear
- flake8-implicit-str-concat
- repo: https://github.com/Riverside-Healthcare/djLint
rev: v1.35.2
rev: v1.36.1
hooks:
- id: djlint-jinja
files: "\\.html"
Expand Down
2 changes: 2 additions & 0 deletions tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ def test_authenticate_with_subdomain_next(app, client, get_message):

@pytest.mark.settings(subdomain="auth")
def test_authenticate_with_root_domain_next(app, client, get_message):
# As of Flask 3.1 this must be explicitly set.
app.subdomain_matching = True
app.config["SERVER_NAME"] = "lp.com"
app.config["SECURITY_REDIRECT_ALLOW_SUBDOMAINS"] = True
data = dict(email="matt@lp.com", password="password")
Expand Down

0 comments on commit c6d2b19

Please sign in to comment.