HTTP/2 framing layer for Python
======================================
.. image:: https://travis-ci.org/python-hyper/hyperframe.png?branch=master :target: https://travis-ci.org/python-hyper/hyperframe
This library contains the HTTP/2 framing code used in the hyper
_ project. It
provides a pure-Python codebase that is capable of decoding a binary stream
into HTTP/2 frames.
This library is used directly by hyper
_ and a number of other projects to
provide HTTP/2 frame decoding logic.
hyperframe welcomes contributions from anyone! Unlike many other projects we are happy to accept cosmetic contributions and small contributions, in addition to large feature requests and changes.
Before you contribute (either by opening an issue or filing a pull request),
please read the contribution guidelines
_.
.. _read the contribution guidelines: http://hyper.readthedocs.org/en/development/contributing.html
hyperframe is made available under the MIT License. For more details, see the
LICENSE
file in the repository.
hyperframe is maintained by Cory Benfield, with contributions from others. For
more details about the contributors, please see CONTRIBUTORS.rst
.
.. _hyper: http://python-hyper.org/
API Changes (Backward-compatible)
DataFrame.data
being a memoryview
object.Backwards Incompatible API Changes
ExtensionFrame
object. The flag information for these frames is persisted
in flag_byte
if needed.Bugfixes
'both'
:
should have been 'either'
.PADDING
flag set but zero-length
padding, whose flow-controlled length was calculated wrongly.Bugfixes
AltSvcFrame
, where building it could throw
exceptions if the frame had been received from the network.Backwards Incompatible API Changes
SettingsFrame.SETTINGS_MAX_FRAME_SIZE
and
SettingsFrame.SETTINGS_MAX_HEADER_LIST_SIZE
.API Changes (Backward-compatible)
InvalidFrameError
, not
ValueError
. Note that InvalidFrameError
is a ValueError
subclass.InvalidFramError
, not
ValueError
. Note that InvalidFrameError
is a ValueError
subclass.SettingsFrame.SETTINGS_MAX_FRAME_SIZE
and
SettingsFrame.SETTINGS_MAX_HEADER_LIST_SIZE
to match their peers, by
adding new properties SettingsFrame.MAX_FRAME_SIZE
and
SettingsFrame.SETTINGS_MAX_HEADER_LIST_SIZE
. The old names are still
present, but will be deprecated in 4.0.0.Bugfixes
3.1.0
that ensured that InvalidFrameError
would be
thrown did not affect certain invalid values in ALTSVC frames. This has been
fixed: ValueError
will no longer be thrown from invalid ALTSVC bodies.Bugfixes
API Changes
InvalidFrameError
that is thrown instead of struct.error
when parsing a frame.Bugfixes
Bugfixes
InvalidPaddingError
exceptions when parsed.Backwards Incompatible API Changes
InvalidPaddingError
.API Changes
parse_frame_header
now throws a
ValueError
subclass: UnknownFrameError
. This subclass contains the
frame type and the length of the frame body.API Changes
body_len
attribute that
matches the frame length (minus the frame header).API Changes
ValueError
instead of
KeyError
. Thanks to @Kriechi!hyperframe
does not recognise and that would not serialize. Thanks to
@mhils!0
. Thanks to @Kriechi!Other Changes
FRAME_MAX_LEN
was one byte too small.body_len
property to frames to enable introspection of the actual
frame length. Thanks to @jdecuyper!