Merge branch '2.0.x'

This commit is contained in:
David Lord 2022-02-09 07:37:43 -08:00
commit e37e87140e
No known key found for this signature in database
GPG key ID: 7A1C87E3F5BC42A8
23 changed files with 221 additions and 180 deletions

View file

@ -2,6 +2,7 @@ import gc
import re
import time
import uuid
import warnings
import weakref
from datetime import datetime
from platform import python_implementation
@ -1525,8 +1526,11 @@ def test_server_name_subdomain():
rv = client.get("/", "https://dev.local")
assert rv.data == b"default"
# suppress Werkzeug 1.0 warning about name mismatch
with pytest.warns(None):
# suppress Werkzeug 0.15 warning about name mismatch
with warnings.catch_warnings():
warnings.filterwarnings(
"ignore", "Current server name", UserWarning, "flask.app"
)
rv = client.get("/", "http://foo.localhost")
assert rv.status_code == 404
@ -1893,7 +1897,10 @@ def test_subdomain_matching_other_name(matching):
return "", 204
# suppress Werkzeug 0.15 warning about name mismatch
with pytest.warns(None):
with warnings.catch_warnings():
warnings.filterwarnings(
"ignore", "Current server name", UserWarning, "flask.app"
)
# ip address can't match name
rv = client.get("/", "http://127.0.0.1:3000/")
assert rv.status_code == 404 if matching else 204