<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/cpython-git.git/Lib/http, branch master</title>
<subtitle>github.com: python/cpython.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/'/>
<entry>
<title>bpo-45328: Avoid failure in OSs without TCP_NODELAY support (GH-28646)</title>
<updated>2021-10-06T17:49:44+00:00</updated>
<author>
<name>rtobar</name>
<email>rtobarc@gmail.com</email>
</author>
<published>2021-10-06T17:49:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=0571b934f5f9198c3461a7b631d7073ac0a5676f'/>
<id>0571b934f5f9198c3461a7b631d7073ac0a5676f</id>
<content type='text'>
Operating systems without support for TCP_NODELAY will raise an OSError
when trying to set the socket option, but the show can still go on.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Operating systems without support for TCP_NODELAY will raise an OSError
when trying to set the socket option, but the show can still go on.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix typos in multiple files (GH-26689)</title>
<updated>2021-06-13T02:47:44+00:00</updated>
<author>
<name>Binbin</name>
<email>binloveplay1314@qq.com</email>
</author>
<published>2021-06-13T02:47:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=17b16e13bb444001534ed6fccb459084596c8bcf'/>
<id>17b16e13bb444001534ed6fccb459084596c8bcf</id>
<content type='text'>
Co-authored-by: Terry Jan Reedy &lt;tjreedy@udel.edu&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Co-authored-by: Terry Jan Reedy &lt;tjreedy@udel.edu&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-43972: Set content-length to 0 for http.server.SimpleHTTPRequestHandler 301s (GH-25705)</title>
<updated>2021-05-06T19:25:52+00:00</updated>
<author>
<name>Stephen Rosen</name>
<email>sirosen@globus.org</email>
</author>
<published>2021-05-06T19:25:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=fb427255614fc1f740e7785554c1da8ca39116c2'/>
<id>fb427255614fc1f740e7785554c1da8ca39116c2</id>
<content type='text'>
* Set content-length for simple http server 301s

When http.server.SimpleHTTPRequestHandler sends a 301 (Moved
Permanently) due to a missing file, it does not set a Content-Length
of 0. Unfortunately, certain clients can be left waiting for the
connection to be closed in this circumstance, even though no body
will be sent. At time of writing, both curl and Firefox demonstrate
this behavior.

* Test Content-Length on simple http server redirect

When serving a redirect, the SimpleHTTPRequestHandler will now send
`Content-Length: 0`. Several tests for http.server already cover
various behaviors and checks including redirection. This change only
adds one check for the expected Content-Length on the simplest case
for a redirect.

* Add news entry for SimpleHTTPRequestHandler fix

* Clarify the specific kind of 301

Co-authored-by: Senthil Kumaran &lt;skumaran@gatech.edu&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Set content-length for simple http server 301s

When http.server.SimpleHTTPRequestHandler sends a 301 (Moved
Permanently) due to a missing file, it does not set a Content-Length
of 0. Unfortunately, certain clients can be left waiting for the
connection to be closed in this circumstance, even though no body
will be sent. At time of writing, both curl and Firefox demonstrate
this behavior.

* Test Content-Length on simple http server redirect

When serving a redirect, the SimpleHTTPRequestHandler will now send
`Content-Length: 0`. Several tests for http.server already cover
various behaviors and checks including redirection. This change only
adds one check for the expected Content-Length on the simplest case
for a redirect.

* Add news entry for SimpleHTTPRequestHandler fix

* Clarify the specific kind of 301

Co-authored-by: Senthil Kumaran &lt;skumaran@gatech.edu&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-44022: Fix http client infinite line reading (DoS) after a HTTP 100 Continue (GH-25916)</title>
<updated>2021-05-05T22:42:41+00:00</updated>
<author>
<name>Gen Xu</name>
<email>xgbarry@gmail.com</email>
</author>
<published>2021-05-05T22:42:41+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=47895e31b6f626bc6ce47d175fe9d43c1098909d'/>
<id>47895e31b6f626bc6ce47d175fe9d43c1098909d</id>
<content type='text'>
Fixes http.client potential denial of service where it could get stuck reading lines from a malicious server after a 100 Continue response.

Co-authored-by: Gregory P. Smith &lt;greg@krypto.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes http.client potential denial of service where it could get stuck reading lines from a malicious server after a 100 Continue response.

Co-authored-by: Gregory P. Smith &lt;greg@krypto.org&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-37363: Add audit events to the `http.client` module (GH-21321)</title>
<updated>2021-04-23T10:19:08+00:00</updated>
<author>
<name>Saiyang Gou</name>
<email>gousaiyang@163.com</email>
</author>
<published>2021-04-23T10:19:08+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=927b841c215a1ca36c9b3203eadc67ce05b1ed07'/>
<id>927b841c215a1ca36c9b3203eadc67ce05b1ed07</id>
<content type='text'>
Add audit events to the `http.client` module

Co-authored-by: blurb-it[bot] &lt;43283697+blurb-it[bot]@users.noreply.github.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add audit events to the `http.client` module

Co-authored-by: blurb-it[bot] &lt;43283697+blurb-it[bot]@users.noreply.github.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-38659: [Enum] add _simple_enum decorator (GH-25497)</title>
<updated>2021-04-21T17:20:44+00:00</updated>
<author>
<name>Ethan Furman</name>
<email>ethan@stoneleaf.us</email>
</author>
<published>2021-04-21T17:20:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=a02cb474f9c097c83cd444a47e9fb5f99b4aaf45'/>
<id>a02cb474f9c097c83cd444a47e9fb5f99b4aaf45</id>
<content type='text'>
add:

* `_simple_enum` decorator to transform a normal class into an enum
* `_test_simple_enum` function to compare
* `_old_convert_` to enable checking `_convert_` generated enums

`_simple_enum` takes a normal class and converts it into an enum:

    @simple_enum(Enum)
    class Color:
        RED = 1
        GREEN = 2
        BLUE = 3

`_old_convert_` works much like` _convert_` does, using the original logic:

    # in a test file
    import socket, enum
    CheckedAddressFamily = enum._old_convert_(
            enum.IntEnum, 'AddressFamily', 'socket',
            lambda C: C.isupper() and C.startswith('AF_'),
            source=_socket,
            )

`_test_simple_enum` takes a traditional enum and a simple enum and
compares the two:

    # in the REPL or the same module as Color
    class CheckedColor(Enum):
        RED = 1
        GREEN = 2
        BLUE = 3

    _test_simple_enum(CheckedColor, Color)

    _test_simple_enum(CheckedAddressFamily, socket.AddressFamily)

Any important differences will raise a TypeError</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
add:

* `_simple_enum` decorator to transform a normal class into an enum
* `_test_simple_enum` function to compare
* `_old_convert_` to enable checking `_convert_` generated enums

`_simple_enum` takes a normal class and converts it into an enum:

    @simple_enum(Enum)
    class Color:
        RED = 1
        GREEN = 2
        BLUE = 3

`_old_convert_` works much like` _convert_` does, using the original logic:

    # in a test file
    import socket, enum
    CheckedAddressFamily = enum._old_convert_(
            enum.IntEnum, 'AddressFamily', 'socket',
            lambda C: C.isupper() and C.startswith('AF_'),
            source=_socket,
            )

`_test_simple_enum` takes a traditional enum and a simple enum and
compares the two:

    # in the REPL or the same module as Color
    class CheckedColor(Enum):
        RED = 1
        GREEN = 2
        BLUE = 3

    _test_simple_enum(CheckedColor, Color)

    _test_simple_enum(CheckedAddressFamily, socket.AddressFamily)

Any important differences will raise a TypeError</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "bpo-38659: [Enum] add _simple_enum decorator (GH-25285)" (GH-25476)</title>
<updated>2021-04-20T02:12:24+00:00</updated>
<author>
<name>Ethan Furman</name>
<email>ethan@stoneleaf.us</email>
</author>
<published>2021-04-20T02:12:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=503cdc7c124cebbd777008bdf7bd9aa666b25f07'/>
<id>503cdc7c124cebbd777008bdf7bd9aa666b25f07</id>
<content type='text'>
This reverts commit dbac8f40e81eb0a29dc833e6409a1abf47467da6.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit dbac8f40e81eb0a29dc833e6409a1abf47467da6.</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-38659: [Enum] add _simple_enum decorator (GH-25285)</title>
<updated>2021-04-20T01:04:53+00:00</updated>
<author>
<name>Ethan Furman</name>
<email>ethan@stoneleaf.us</email>
</author>
<published>2021-04-20T01:04:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=dbac8f40e81eb0a29dc833e6409a1abf47467da6'/>
<id>dbac8f40e81eb0a29dc833e6409a1abf47467da6</id>
<content type='text'>
add:

_simple_enum decorator to transform a normal class into an enum
_test_simple_enum function to compare
_old_convert_ to enable checking _convert_ generated enums
_simple_enum takes a normal class and converts it into an enum:

@simple_enum(Enum)
class Color:
    RED = 1
    GREEN = 2
    BLUE = 3

_old_convert_ works much like _convert_ does, using the original logic:

# in a test file
import socket, enum
CheckedAddressFamily = enum._old_convert_(
        enum.IntEnum, 'AddressFamily', 'socket',
        lambda C: C.isupper() and C.startswith('AF_'),
        source=_socket,
        )

test_simple_enum takes a traditional enum and a simple enum and
compares the two:

# in the REPL or the same module as Color
class CheckedColor(Enum):
    RED = 1
    GREEN = 2
    BLUE = 3

_test_simple_enum(CheckedColor, Color)

_test_simple_enum(CheckedAddressFamily, socket.AddressFamily)

Any important differences will raise a TypeError</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
add:

_simple_enum decorator to transform a normal class into an enum
_test_simple_enum function to compare
_old_convert_ to enable checking _convert_ generated enums
_simple_enum takes a normal class and converts it into an enum:

@simple_enum(Enum)
class Color:
    RED = 1
    GREEN = 2
    BLUE = 3

_old_convert_ works much like _convert_ does, using the original logic:

# in a test file
import socket, enum
CheckedAddressFamily = enum._old_convert_(
        enum.IntEnum, 'AddressFamily', 'socket',
        lambda C: C.isupper() and C.startswith('AF_'),
        source=_socket,
        )

test_simple_enum takes a traditional enum and a simple enum and
compares the two:

# in the REPL or the same module as Color
class CheckedColor(Enum):
    RED = 1
    GREEN = 2
    BLUE = 3

_test_simple_enum(CheckedColor, Color)

_test_simple_enum(CheckedAddressFamily, socket.AddressFamily)

Any important differences will raise a TypeError</pre>
</div>
</content>
</entry>
<entry>
<title>Update client.py (GH-24827)</title>
<updated>2021-03-13T12:22:03+00:00</updated>
<author>
<name>Géry Ogam</name>
<email>gery.ogam@gmail.com</email>
</author>
<published>2021-03-13T12:22:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=b6884ad2688451dd3cbc5984b23da5840e1b6df8'/>
<id>b6884ad2688451dd3cbc5984b23da5840e1b6df8</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-43332: Buffer proxy connection setup packets before sending. (GH-24780)</title>
<updated>2021-03-08T07:35:13+00:00</updated>
<author>
<name>Gregory P. Smith</name>
<email>greg@krypto.org</email>
</author>
<published>2021-03-08T07:35:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=c25910a135c2245accadb324b40dd6453015e056'/>
<id>c25910a135c2245accadb324b40dd6453015e056</id>
<content type='text'>
We now buffer the CONNECT request + tunnel HTTP headers into a single
send call.  This prevents the OS from generating multiple network
packets for connection setup when not necessary, improving efficiency.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We now buffer the CONNECT request + tunnel HTTP headers into a single
send call.  This prevents the OS from generating multiple network
packets for connection setup when not necessary, improving efficiency.
</pre>
</div>
</content>
</entry>
</feed>
