Skip to content

bpo-41521: Replace denylist with blocklist is http.cookiejar doc #21826

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Doc/library/http.cookiejar.rst
Original file line number Diff line number Diff line change
Expand Up @@ -462,16 +462,16 @@ receiving cookies. There are also some strictness switches that allow you to
tighten up the rather loose Netscape protocol rules a little bit (at the cost of
blocking some benign cookies).

A domain denylist and allowlist is provided (both off by default). Only domains
not in the denylist and present in the allowlist (if the allowlist is active)
A domain blocklist and allowlist is provided (both off by default). Only domains
not in the blocklist and present in the allowlist (if the allowlist is active)
participate in cookie setting and returning. Use the *blocked_domains*
constructor argument, and :meth:`blocked_domains` and
:meth:`set_blocked_domains` methods (and the corresponding argument and methods
for *allowed_domains*). If you set an allowlist, you can turn it off again by
setting it to :const:`None`.

Domains in block or allow lists that do not start with a dot must equal the
cookie domain to be matched. For example, ``"example.com"`` matches a denylist
cookie domain to be matched. For example, ``"example.com"`` matches a blocklist
entry of ``"example.com"``, but ``"www.example.com"`` does not. Domains that do
start with a dot are matched by more specific domains too. For example, both
``"www.example.com"`` and ``"www.coyote.example.com"`` match ``".example.com"``
Expand All @@ -494,7 +494,7 @@ and ``".168.1.2"``, 192.168.1.2 is blocked, but 193.168.1.2 is not.

.. method:: DefaultCookiePolicy.is_blocked(domain)

Return whether *domain* is on the denylist for setting or receiving cookies.
Return whether *domain* is on the blocklist for setting or receiving cookies.


.. method:: DefaultCookiePolicy.allowed_domains()
Expand Down
6 changes: 3 additions & 3 deletions Lib/test/test___all__.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ def test_all(self):
lib_dir = os.path.dirname(os.path.dirname(__file__))
for path, modname in self.walk_modules(lib_dir, ""):
m = modname
denylisted = False
denied = False
while m:
if m in denylist:
denylisted = True
denied = True
break
m = m.rpartition('.')[0]
if denylisted:
if denied:
continue
if support.verbose:
print(modname)
Expand Down