<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/cpython-git.git/Lib/http, branch main</title>
<subtitle>github.com: python/cpython.git
</subtitle>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/'/>
<entry>
<title>gh-69152: add method get_proxy_response_headers to HTTPConnection class (#104248)</title>
<updated>2023-05-16T06:20:30+00:00</updated>
<author>
<name>Alexey Namyotkin</name>
<email>62434915+nametkin@users.noreply.github.com</email>
</author>
<published>2023-05-16T06:20:30+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=85ec192ac4b000d4e47df6123b65eacbd1fdccfa'/>
<id>85ec192ac4b000d4e47df6123b65eacbd1fdccfa</id>
<content type='text'>
Add http.client.HTTPConnection method get_proxy_response_headers() - this is a followup to https://github.com/python/cpython/pull/26152 which added it as a non-public attribute. This way we don't pre-compute a headers dictionary that most users will never access. The new method is properly public and documented and triggers full proxy header parsing into a dict only when actually called.

---------

Co-authored-by: blurb-it[bot] &lt;43283697+blurb-it[bot]@users.noreply.github.com&gt;
Co-authored-by: Gregory P. Smith &lt;greg@krypto.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add http.client.HTTPConnection method get_proxy_response_headers() - this is a followup to https://github.com/python/cpython/pull/26152 which added it as a non-public attribute. This way we don't pre-compute a headers dictionary that most users will never access. The new method is properly public and documented and triggers full proxy header parsing into a dict only when actually called.

---------

Co-authored-by: blurb-it[bot] &lt;43283697+blurb-it[bot]@users.noreply.github.com&gt;
Co-authored-by: Gregory P. Smith &lt;greg@krypto.org&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>gh-103204: `http.server` - Enforce that HTTP version numbers must consist only of digits (#103205)</title>
<updated>2023-05-12T20:25:58+00:00</updated>
<author>
<name>Ben Kallus</name>
<email>49924171+kenballus@users.noreply.github.com</email>
</author>
<published>2023-05-12T20:25:58+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=cf720acfcbd8c9c25a706a4b6df136465a803992'/>
<id>cf720acfcbd8c9c25a706a4b6df136465a803992</id>
<content type='text'>
Reject HTTP requests with invalid http/x.y version numbers: x or y being non-digits or too-long.

---------

Co-authored-by: Oleg Iarygin &lt;oleg@arhadthedev.net&gt;
Co-authored-by: Gregory P. Smith &lt;greg@krypto.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reject HTTP requests with invalid http/x.y version numbers: x or y being non-digits or too-long.

---------

Co-authored-by: Oleg Iarygin &lt;oleg@arhadthedev.net&gt;
Co-authored-by: Gregory P. Smith &lt;greg@krypto.org&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>gh-69152: Add _proxy_response_headers attribute to HTTPConnection (#26152)</title>
<updated>2023-05-05T18:52:24+00:00</updated>
<author>
<name>Alexey Namyotkin</name>
<email>62434915+nametkin@users.noreply.github.com</email>
</author>
<published>2023-05-05T18:52:24+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=1afe0e0320c6f19418d44d682ad95ba0c689c595'/>
<id>1afe0e0320c6f19418d44d682ad95ba0c689c595</id>
<content type='text'>
Add _proxy_response_headers attribute to HTTPConnection (#26152)

---------

Co-authored-by: Senthil Kumaran &lt;senthil@python.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add _proxy_response_headers attribute to HTTPConnection (#26152)

---------

Co-authored-by: Senthil Kumaran &lt;senthil@python.org&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>gh-104049: do not expose on-disk location from SimpleHTTPRequestHandler (#104067)</title>
<updated>2023-05-03T03:42:00+00:00</updated>
<author>
<name>Ethan Furman</name>
<email>ethan@stoneleaf.us</email>
</author>
<published>2023-05-03T03:42:00+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=c7c3a60c88de61a79ded9fdaf6bc6a29da4efb9a'/>
<id>c7c3a60c88de61a79ded9fdaf6bc6a29da4efb9a</id>
<content type='text'>
Do not expose the local server's on-disk location from `SimpleHTTPRequestHandler` when generating a directory index. (unnecessary information disclosure)

---------

Co-authored-by: Gregory P. Smith &lt;greg@krypto.org&gt;
Co-authored-by: Jelle Zijlstra &lt;jelle.zijlstra@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Do not expose the local server's on-disk location from `SimpleHTTPRequestHandler` when generating a directory index. (unnecessary information disclosure)

---------

Co-authored-by: Gregory P. Smith &lt;greg@krypto.org&gt;
Co-authored-by: Jelle Zijlstra &lt;jelle.zijlstra@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>GH-103472: close response in HTTPConnection._tunnel (#103473)</title>
<updated>2023-05-02T03:59:42+00:00</updated>
<author>
<name>Thomas Grainger</name>
<email>tagrain@gmail.com</email>
</author>
<published>2023-05-02T03:59:42+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=9de0cf20fa0485e327e57cc0864c7476da85cfad'/>
<id>9de0cf20fa0485e327e57cc0864c7476da85cfad</id>
<content type='text'>
Avoid a potential `ResourceWarning` in `http.client.HTTPConnection`
by closing the proxy / tunnel's CONNECT response explicitly.

---------

Co-authored-by: Gregory P. Smith &lt;greg@krypto.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Avoid a potential `ResourceWarning` in `http.client.HTTPConnection`
by closing the proxy / tunnel's CONNECT response explicitly.

---------

Co-authored-by: Gregory P. Smith &lt;greg@krypto.org&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>GH-103857: Deprecate utcnow and utcfromtimestamp (#103858)</title>
<updated>2023-04-27T17:32:30+00:00</updated>
<author>
<name>Paul Ganssle</name>
<email>1377457+pganssle@users.noreply.github.com</email>
</author>
<published>2023-04-27T17:32:30+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=0b7fd8ffc5df187edf8b5d926cee359924462df5'/>
<id>0b7fd8ffc5df187edf8b5d926cee359924462df5</id>
<content type='text'>
Using `datetime.datetime.utcnow()` and `datetime.datetime.utcfromtimestamp()` will now raise a `DeprecationWarning`.

We also have removed our internal uses of these functions and documented the change.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Using `datetime.datetime.utcnow()` and `datetime.datetime.utcfromtimestamp()` will now raise a `DeprecationWarning`.

We also have removed our internal uses of these functions and documented the change.</pre>
</div>
</content>
</entry>
<entry>
<title>gh-66897: Upgrade HTTP CONNECT to protocol HTTP/1.1 (#8305)</title>
<updated>2023-04-05T04:55:24+00:00</updated>
<author>
<name>Michael Handler</name>
<email>mh@grendel.net</email>
</author>
<published>2023-04-05T04:55:24+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=1a8f862e329c3872a11d4ef8eb85cf353ca2f4d5'/>
<id>1a8f862e329c3872a11d4ef8eb85cf353ca2f4d5</id>
<content type='text'>
* bpo-22708: Upgrade HTTP CONNECT to protocol HTTP/1.1 (GH-NNNN)

Use protocol HTTP/1.1 when sending HTTP CONNECT tunnelling requests;
generate Host: headers if one is not already provided (required by
HTTP/1.1), convert IDN domains to punycode in HTTP CONNECT requests.

* Refactor tests to pass under -bb (fix ByteWarnings); missed some lines &gt;80.

* Use consistent 'tunnelling' spelling in Lib/http/client.py

* Lib/test/test_httplib: Remove remnant of obsoleted test.

* Use dict.copy() not copy.copy()

* fix version changed

* Update Lib/http/client.py

Co-authored-by: bgehman &lt;bgehman@users.noreply.github.com&gt;

* Switch to for/else: syntax, as suggested

* Don't use for: else:

* Sure, fine, w/e

* Oops

* 1nm to the left

---------

Co-authored-by: Éric &lt;merwok@netwok.org&gt;
Co-authored-by: bgehman &lt;bgehman@users.noreply.github.com&gt;
Co-authored-by: Oleg Iarygin &lt;oleg@arhadthedev.net&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* bpo-22708: Upgrade HTTP CONNECT to protocol HTTP/1.1 (GH-NNNN)

Use protocol HTTP/1.1 when sending HTTP CONNECT tunnelling requests;
generate Host: headers if one is not already provided (required by
HTTP/1.1), convert IDN domains to punycode in HTTP CONNECT requests.

* Refactor tests to pass under -bb (fix ByteWarnings); missed some lines &gt;80.

* Use consistent 'tunnelling' spelling in Lib/http/client.py

* Lib/test/test_httplib: Remove remnant of obsoleted test.

* Use dict.copy() not copy.copy()

* fix version changed

* Update Lib/http/client.py

Co-authored-by: bgehman &lt;bgehman@users.noreply.github.com&gt;

* Switch to for/else: syntax, as suggested

* Don't use for: else:

* Sure, fine, w/e

* Oops

* 1nm to the left

---------

Co-authored-by: Éric &lt;merwok@netwok.org&gt;
Co-authored-by: bgehman &lt;bgehman@users.noreply.github.com&gt;
Co-authored-by: Oleg Iarygin &lt;oleg@arhadthedev.net&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>gh-103112: Add http.client.HTTPResponse.read docstring and fix pydoc output (#103113)</title>
<updated>2023-03-29T19:21:56+00:00</updated>
<author>
<name>Bernhard Wagner</name>
<email>github.comNotification20120125@xmlizer.net</email>
</author>
<published>2023-03-29T19:21:56+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=d052a383f1a0c599c176a12c73a761ca00436d8b'/>
<id>d052a383f1a0c599c176a12c73a761ca00436d8b</id>
<content type='text'>
Co-authored-by: blurb-it[bot] &lt;43283697+blurb-it[bot]@users.noreply.github.com&gt;
Co-authored-by: Terry Jan Reedy &lt;tjreedy@udel.edu&gt;
Co-authored-by: Éric &lt;merwok@netwok.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Co-authored-by: blurb-it[bot] &lt;43283697+blurb-it[bot]@users.noreply.github.com&gt;
Co-authored-by: Terry Jan Reedy &lt;tjreedy@udel.edu&gt;
Co-authored-by: Éric &lt;merwok@netwok.org&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>gh-91219: http - use subclassing to override index_pages attribute (GH-100731)</title>
<updated>2023-01-03T23:20:08+00:00</updated>
<author>
<name>Ethan Furman</name>
<email>ethan@stoneleaf.us</email>
</author>
<published>2023-01-03T23:20:08+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=a286caa937405f7415dcc095a7ad5097c4433246'/>
<id>a286caa937405f7415dcc095a7ad5097c4433246</id>
<content type='text'>
Remove previously added parameter to `__init__`, and recommend subclassing to modify the `index_pages` attribute instead.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove previously added parameter to `__init__`, and recommend subclassing to modify the `index_pages` attribute instead.</pre>
</div>
</content>
</entry>
<entry>
<title>gh-100519: simplification to `eff_request_host` in cookiejar.py (#99588)</title>
<updated>2022-12-25T00:14:51+00:00</updated>
<author>
<name>Glyph</name>
<email>code@glyph.im</email>
</author>
<published>2022-12-25T00:14:51+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=b9aa14a484f653cb6a3a242776df9ac5fe161bfc'/>
<id>b9aa14a484f653cb6a3a242776df9ac5fe161bfc</id>
<content type='text'>
`IPV4_RE` includes a `.`, and the `.find(".") == -1` included here is already testing to make sure there's no dot, so this part of the expression is tautological. Instead use more modern `in` syntax to make it clear what the check is doing here. The simplified implementation more clearly matches the wording in RFC 2965.

Co-authored-by: hauntsaninja &lt;hauntsaninja@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`IPV4_RE` includes a `.`, and the `.find(".") == -1` included here is already testing to make sure there's no dot, so this part of the expression is tautological. Instead use more modern `in` syntax to make it clear what the check is doing here. The simplified implementation more clearly matches the wording in RFC 2965.

Co-authored-by: hauntsaninja &lt;hauntsaninja@gmail.com&gt;</pre>
</div>
</content>
</entry>
</feed>
