Skip to content

Commit

Permalink
Small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Yourun-proger committed Mar 18, 2022
1 parent 789c9a3 commit 131838f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 16 deletions.
2 changes: 1 addition & 1 deletion docs/arguments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion src/waitress/adjustments.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
14 changes: 0 additions & 14 deletions tests/test_adjustments.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,20 +354,6 @@ def test_no_trusted_proxy_headers_trusted_proxy(self):
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()
Expand Down

0 comments on commit 131838f

Please sign in to comment.