h11

Frameworks & LibrariesMIT

h11 release notes.

Latest 0.16.0 · by h11WebsitePyPI · h11RSS

Changelog

0.16.0

Latest
Security 1
  • Reject certain malformed Transfer-Encoding: chunked bodies that were previously accepted to prevent request-smuggling attacks when an h11-based HTTP server is placed behind a load balancer with a matching bug in its chunked handling

From h11

Security fix

Reject certain malformed Transfer-Encoding: chunked bodies that were previously accepted. These could have enabled request-smuggling attacks when an h11-based HTTP server was placed behind a load balancer with a matching bug in its chunked handling.

Advisory with more details: https://github.com/python-hyper/h11/security/advisories/GHSA-vqfr-h8mv-ghfj

Reported by: Jeppe Bonde Weikop

View originalPermalink
How 0.16.0 went

0.15.0

Changed 1
  • Remove the tests folder from wheel files to reduce zipped file size by 20KB
Fixed 1
  • Reject Content-Lengths >= 1 zettabyte early without attempting to parse the integer

From h11

Bugfixes
Miscellaneous internal changes
  • Remove the tests folder from wheel files. This reduces the zipped file size by 20KB (about 30%). (#158)
View originalPermalink
How 0.15.0 went

0.14.0

Added 1
  • Allow additional trailing whitespace in chunk headers for additional compatibility with existing servers
Changed 1
  • Improve the type hints for Sentinel types
Removed 1
  • Python 3.6 support is removed; h11 now requires Python>=3.7 including PyPy 3

From h11

Features
  • Allow additional trailing whitespace in chunk headers for additional compatibility with existing servers. (#133)
  • Improve the type hints for Sentinel types, which should make it easier to type hint h11 usage. (#151 & #144))
Deprecations and Removals
  • Python 3.6 support is removed. h11 now requires Python>=3.7 including PyPy 3. Users running pip install h11 on Python 2 will automatically get the last Python 2-compatible version. (#138)
View originalPermalink
How 0.14.0 went

0.13.0

Added 1
  • Add typing including a PEP 561 marker for usage by type checkers
Changed 5
  • Headers class now inherits from collections.abc.Sequence abstract base class to indicate it is a Sequence and gain mixin methods
  • Event classes switched to dataclasses for easier typing and slightly improved performance
  • Traceback of protocol errors is shortened for easier readability
  • Expand the allowed status codes to [0, 999] from [0, 600]
  • Request method is now required to be a valid token

From h11

Features
  • Clarify that the Headers class is a Sequence and inherit from the collections Sequence abstract base class to also indicate this (and gain the mixin methods). See also #104. (#112)
  • Switch event classes to dataclasses for easier typing and slightly improved performance. (#124)
  • Shorten traceback of protocol errors for easier readability (#132).
  • Add typing including a PEP 561 marker for usage by type checkers (#135).
  • Expand the allowed status codes to [0, 999] from [0, 600] (`#134 https://github.com/python-hyper/h11/issues/134`__).
Backwards incompatible changes
View originalPermalink
How 0.13.0 went

0.12.0

Added 2
  • Support for servers with broken line endings by accepting both \r\n and \n as headers delimiter
  • Early detection of invalid HTTP data when request line starts with binary
Removed 1
  • Python 2.7 and PyPy 2 support; h11 now requires Python>=3.6 including PyPy 3

From h11

Features
  • Added support for servers with broken line endings.
    After this change h11 accepts both \r\n and \n as a headers delimiter. (#7)
  • Add early detection of invalid http data when request line starts with binary (#122)
Deprecations and Removals
  • Python 2.7 and PyPy 2 support is removed. h11 now requires Python>=3.6 including PyPy 3. Users running pip install h11 on Python 2 will automatically get the last Python 2-compatible version. (#114)
View originalPermalink
How 0.12.0 went

0.11.0

Added 1
  • h11 now stores and makes available the raw header name as received
Changed 3
  • h11 will write out header names with the same casing as passed to it
  • Multiple content length headers are now merged into a single header if all the values are equal
  • Headers added by h11 now have titlecased names instead of lowercased names
Fixed 1
  • If any content length headers are unequal a LocalProtocol error is raised

From h11

New features:

  • h11 now stores and makes available the raw header name as received. In addition h11 will write out header names with the same casing as passed to it. This allows compatibility with systems that expect titlecased header names. See #31.
  • Multiple content length headers are now merged into a single header if all the values are equal, if any are unequal a LocalProtocol error is raised (as before). See #92.

Backwards incompatible changes:

  • Headers added by h11, rather than passed to it, now have titlecased names. Whilst this should help compatibility it replaces the previous lowercased header names.
View originalPermalink
How 0.11.0 went

0.10.0

Added 1
  • Support Python 3.8
Changed 1
  • Make error messages returned by match failures less ambiguous
Removed 1
  • Drop support for Python 3.4

From h11

Other changes:

  • Drop support for Python 3.4.
  • Support Python 3.8.
  • Make error messages returned by match failures less ambiguous (#98).
View originalPermalink
How 0.10.0 went

0.9.0

Changed 3
  • Allow a broader range of characters in header values for compatibility with real-world code
  • Make all sentinel values inspectable by IDEs and split SEND_BODY_DONE into SEND_BODY and DONE
  • LocalProtocolError raised in start_next_cycle now shows states for more informative errors
Fixed 1
  • Force status codes to be integers to allow stdlib HTTPStatus IntEnums to be used when constructing responses
Removed 1
  • Drop support for Python 3.3
Security 1
  • Validate incoming and outgoing request paths for invalid characters to prevent security issues

From h11

Bug fixes:

  • Allow a broader range of characters in header values. This violates the RFC, but is apparently required for compatibility with real-world code, like Google Analytics cookies (#57, #58).
  • Validate incoming and outgoing request paths for invalid characters. This prevents a variety of potential security issues that have affected other HTTP clients. (#69).
  • Force status codes to be integers, thereby allowing stdlib HTTPStatus IntEnums to be used when constructing responses (#72).

Other changes:

  • Make all sentinel values inspectable by IDEs, and split SEND_BODY_DONE into SEND_BODY, and DONE (#75).
  • Drop support for Python 3.3.
  • LocalProtocolError raised in start_next_cycle now shows states for more informative errors (#80).
View originalPermalink
How 0.9.0 went

0.8.1

Added 1
  • Added proper license notices to the Javascript used in documentation
Fixed 1
  • Always return headers as bytes objects

From h11

Bug fixes:

  • Always return headers as bytes objects (#60)

Other changes:

  • Added proper license notices to the Javascript used in our documentation (#61)
View originalPermalink
How 0.8.1 went

0.8.0

Added 1
  • New method Connection.send_failed() to notify a Connection object when data returned from Connection.send() was not sent
Changed 3
  • h11 now performs stricter validation on outgoing header names and header values, rejecting illegal characters and header values with leading or trailing whitespace
  • Provide correct error_status_hint in exception raised when encountering an invalid Transfer-Encoding header
  • h11 now tolerates responses where the reason phrase is missing for better compatibility with broken servers
Fixed 4
  • Ensure that when computing the framing headers for HEAD responses, produce the same results as for the corresponding GET
  • Error out if a request has multiple Host headers
  • Send the Host header first, as recommended by RFC 7230
  • Use case-insensitive matching when looking for 100-continue in the Expect header

From h11

Backwards incompatible changes:

  • h11 now performs stricter validation on outgoing header names and header values: illegal characters are now rejected (example: you can’t put a newline into an HTTP header), and header values with leading/trailing whitespace are also rejected (previously h11 would silently discard the whitespace). All these checks were already performed on incoming headers; this just extends that to outgoing headers.

New features:

Bug fixes:

  • Make sure that when computing the framing headers for HEAD responses, we produce the same results as we would for the corresponding GET.
  • Error out if a request has multiple Host: headers.
  • Send the Host: header first, as recommended by RFC 7230.
  • The Expect: header is case-insensitive, so use case-insensitive matching when looking for 100-continue.

Other changes:

  • Better error messages in several cases.
  • Provide correct error_status_hint in exception raised when encountering an invalid Transfer-Encoding header.
  • For better compatibility with broken servers, h11 now tolerates responses where the reason phrase is missing (not just empty).
  • Various optimizations and documentation improvements.
View originalPermalink
How 0.8.0 went

0.7.0

Added 3
  • Made sentinels instances of themselves to enable dispatch tricks on the return value of Connection.next_event()
  • Added Data.chunk_start and Data.chunk_end properties to provide information about chunk delimiter locations in the data stream when chunked transfer encoding is in use
  • Expose Response.reason attribute to read or set the textual reason phrase on responses
Fixed 2
  • Fix the error message given when a call to an event constructor is missing a required keyword argument
  • Fixed encoding of empty Data events when using chunked encoding

From h11

New features (backwards compatible):

Bug fixes:

  • Fix the error message given when a call to an event constructor is missing a required keyword argument (issue #14).
  • Fixed encoding of empty Data events (Data(data=b"")) when using chunked encoding (issue #21).
View originalPermalink
How 0.7.0 went

0.6.0

Added 3
  • Added DONE to MUST_CLOSE state transition triggered when peer is in ERROR state
  • Split ProtocolError into LocalProtocolError and RemoteProtocolError for distinguishing local vs remote errors
  • Added minimal benchmark suite
Changed 5
  • Split receive_data() into receive_data() and next_event() methods
  • Replaced Paused pseudo-event with NEED_DATA and PAUSED sentinels
  • Simplified API by replacing Connection.state_of(), Connection.client_state, and Connection.server_state with Connection.states
  • Renamed prepare_to_reuse() to start_next_cycle()
  • Changed PRODUCT_ID from h11/<version> to python-h11/<version>
Removed 1
  • Removed Paused pseudo-event

From h11

This is the first release since we started using h11 to write non-trivial server code, and this experience triggered a number of substantial API changes.

Backwards incompatible changes:

  • Split the old receive_data() into the new receive_data() and next_event(), and replaced the old Pausedpseudo-event with the new NEED_DATA and PAUSEDsentinels.
  • Simplified the API by replacing the old Connection.state_of(), Connection.client_state, Connection.server_state with the new Connection.states.
  • Renamed the old prepare_to_reuse() to the new start_next_cycle().
  • Removed the Paused pseudo-event.

Backwards compatible changes:

  • State machine: added a DONE -> MUST_CLOSE transition triggered by our peer being in the ERROR state.
  • Split ProtocolError into LocalProtocolError and RemoteProtocolError (see Error handling). Use case: HTTP servers want to be able to distinguish between an error that originates locally (which produce a 500 status code) versus errors caused by remote misbehavior (which produce a 4xx status code).
  • Changed the PRODUCT_ID from h11/<verson> to python-h11/<version>. (This is similar to what requests uses, and much more searchable than plain h11.)

Other changes:

  • Added a minimal benchmark suite, and used it to make a few small optimizations (maybe ~20% speedup?).
View originalPermalink
How 0.6.0 went

0.5.0

  • Initial release.
View originalPermalink
How 0.5.0 went
View all

Discussion