summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYourun-Proger <shkrobov.yura@mail.ru>2022-03-18 17:18:37 +0300
committerYourun-Proger <shkrobov.yura@mail.ru>2022-03-18 17:18:37 +0300
commit131838f6d48f09a76cebd5d943857ed84fe4e87f (patch)
tree7175491e8730efadf82b593d32a43daf7415eb00
parent789c9a3874af408ba89b6373fe2ef80978c0f4c8 (diff)
downloadwaitress-131838f6d48f09a76cebd5d943857ed84fe4e87f.tar.gz
Small fix
-rw-r--r--docs/arguments.rst2
-rw-r--r--src/waitress/adjustments.py2
-rw-r--r--tests/test_adjustments.py14
3 files changed, 2 insertions, 16 deletions
diff --git a/docs/arguments.rst b/docs/arguments.rst
index 4045f64..db765e4 100644
--- a/docs/arguments.rst
+++ b/docs/arguments.rst
@@ -160,7 +160,7 @@ clear_untrusted_proxy_headers
Default: ``True``
- .. versionchanged:: 2.1.1
+ .. versionchanged:: 2.1.2
In this version default value is set to ``True`` and deprecation warning
doesn't show up anymore.
diff --git a/src/waitress/adjustments.py b/src/waitress/adjustments.py
index 85689d4..6e9b702 100644
--- a/src/waitress/adjustments.py
+++ b/src/waitress/adjustments.py
@@ -175,7 +175,7 @@ class Adjustments:
# sense to set when you have a trusted_proxy, and you expect the upstream
# proxy server to filter invalid headers
log_untrusted_proxy_headers = False
-
+
# Changed this parameter to True by default in 2.x
clear_untrusted_proxy_headers = True
diff --git a/tests/test_adjustments.py b/tests/test_adjustments.py
index 69cdf51..cbbb006 100644
--- a/tests/test_adjustments.py
+++ b/tests/test_adjustments.py
@@ -354,20 +354,6 @@ class TestAdjustments(unittest.TestCase):
self.assertTrue(issubclass(w[0].category, DeprecationWarning))
self.assertIn("Implicitly trusting X-Forwarded-Proto", str(w[0]))
- def test_clear_untrusted_proxy_headers(self):
- with warnings.catch_warnings(record=True) as w:
- warnings.resetwarnings()
- warnings.simplefilter("always")
- self._makeOne(
- trusted_proxy="localhost", trusted_proxy_headers={"x-forwarded-for"}
- )
-
- self.assertGreaterEqual(len(w), 1)
- self.assertTrue(issubclass(w[0].category, DeprecationWarning))
- self.assertIn(
- "clear_untrusted_proxy_headers will be set to True", str(w[0])
- )
-
def test_deprecated_send_bytes(self):
with warnings.catch_warnings(record=True) as w:
warnings.resetwarnings()