GeezerVison is showing github.com — gh-89735: Document requirements for the *headers* argument (GH-155640) · python/cpython@1414d2a
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: Doc/library/urllib.request.rst +7Lines changed: 7 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1056,6 +1056,10 @@ AbstractBasicAuthHandler Objects |
1056 | 1056 | authenticate for, *req* should be the (failed) :class:`Request` object, and |
1057 | 1057 | *headers* should be the error headers. |
1058 | 1058 |
|
| 1059 | + *headers* must be a mapping-like object with case-insensitive lookup |
| 1060 | + that implements the ``get_all()`` method, |
| 1061 | + such as :class:`email.message.Message` or :class:`wsgiref.headers.Headers`. |
| 1062 | + |
1059 | 1063 | *host* is either an authority (e.g. ``"python.org"``) or a URL containing an |
1060 | 1064 | authority component (e.g. ``"https://python.org/"``). In either case, the |
1061 | 1065 | authority must not contain a userinfo component (so, ``"python.org"`` and |
@@ -1097,6 +1101,9 @@ AbstractDigestAuthHandler Objects |
1097 | 1101 | should be the (failed) :class:`Request` object, and *headers* should be the |
1098 | 1102 | error headers. |
1099 | 1103 |
|
| 1104 | + *headers* must be a mapping-like object with case-insensitive lookup, |
| 1105 | + such as :class:`email.message.Message` or :class:`wsgiref.headers.Headers`. |
| 1106 | + |
1100 | 1107 |
|
1101 | 1108 | .. _http-digest-auth-handler: |
1102 | 1109 |
|
|