Skip to content

Commit

Permalink
consolidate AcceptEncodingXXXHeader classes into the single AcceptEnc…
Browse files Browse the repository at this point in the history
…oding class
  • Loading branch information
mmerickel committed Mar 4, 2024
1 parent 0afa9f2 commit 50f6669
Show file tree
Hide file tree
Showing 5 changed files with 550 additions and 1,519 deletions.
30 changes: 30 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ Feature
``acceptable_offers``. See backward incompatibilities below.
See https://github.com/Pylons/webob/pull/461

- Consolidation of ``AcceptEncoding`` header handling into a single class.
See backward incompatibilities below for more information.
See https://github.com/Pylons/webob/pull/462

- ``webob.acceptparse.AcceptEncoding``, methods ``best_match``, ``quality``,
and ``__contains__`` are undeprecated and their logic is made consistent with
``acceptable_offers``. See backward incompatibilities below.
See https://github.com/Pylons/webob/pull/462

Compatibility
~~~~~~~~~~~~~

Expand Down Expand Up @@ -84,6 +93,27 @@ Backwards Incompatibilities

See https://github.com/Pylons/webob/pull/461

- Remove ``AcceptEncodingValidHeader``, ``AcceptEncodingNoHeader`` and
``AcceptEncodingInvalidHeader``. These classes are consolidated into
``AcceptEncoding`` with a ``header_state`` attribute for users that need
to know the state of the header.
See https://github.com/Pylons/webob/pull/462

- Remove previously-deprecated ``webob.acceptparse.AcceptEncoding.__iter__``.
See https://github.com/Pylons/webob/pull/462

- ``webob.acceptparse.AcceptEncoding`` methods, ``best_match``, ``quality``,
and ``__contains__`` are now thin wrappers around ``acceptable_offers`` which
modifies their behavior slightly:

- A tuple can no longer be an offer containing server-side quality values.
- An offer will only match a ``*`` clause in a header if it does not match
any other clauses.
- The ``identity`` offer was not properly considered a match unless the
header explicitly it excluded via ``*;q=0`` or ``identity;q=0``.

See https://github.com/Pylons/webob/pull/462

Experimental Features
~~~~~~~~~~~~~~~~~~~~~

Expand Down
20 changes: 4 additions & 16 deletions docs/api/webob.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,10 @@ methods:
acceptable_offers, best_match, quality

.. autoclass:: AcceptEncoding
:members: parse

.. autoclass:: AcceptEncodingValidHeader
:members: parse, header_value, parsed, __init__, __add__, __bool__,
__contains__, __iter__, __radd__, __repr__, __str__,
acceptable_offers, best_match, quality

.. autoclass:: AcceptEncodingNoHeader
:members: parse, header_value, parsed, __init__, __add__, __bool__,
__contains__, __iter__, __radd__, __repr__, __str__,
acceptable_offers, best_match, quality

.. autoclass:: AcceptEncodingInvalidHeader
:members: parse, header_value, parsed, __init__, __add__, __bool__,
__contains__, __iter__, __radd__, __repr__, __str__,
acceptable_offers, best_match, quality
:members:
parse, header_value, parsed, header_state, __init__, __add__,
__bool__, __radd__, __repr__, __str__, __contains__, copy,
acceptable_offers, best_match, quality

.. autoclass:: AcceptLanguage
:members: parse
Expand Down
Loading

0 comments on commit 50f6669

Please sign in to comment.