Skip to content

Commit d19faa7

Browse files
committed
consolidate AcceptEncodingXXXHeader classes into the single AcceptEncoding class
1 parent 6fc063e commit d19faa7

File tree

5 files changed

+550
-1519
lines changed

5 files changed

+550
-1519
lines changed

CHANGES.txt

+30
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@ Feature
3434
``acceptable_offers``. See backward incompatibilities below.
3535
See https://github.com/Pylons/webob/pull/461
3636

37+
- Consolidation of ``AcceptEncoding`` header handling into a single class.
38+
See backward incompatibilities below for more information.
39+
See https://github.com/Pylons/webob/pull/462
40+
41+
- ``webob.acceptparse.AcceptEncoding``, methods ``best_match``, ``quality``,
42+
and ``__contains__`` are undeprecated and their logic is made consistent with
43+
``acceptable_offers``. See backward incompatibilities below.
44+
See https://github.com/Pylons/webob/pull/462
45+
3746
Compatibility
3847
~~~~~~~~~~~~~
3948

@@ -84,6 +93,27 @@ Backwards Incompatibilities
8493

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

96+
- Remove ``AcceptEncodingValidHeader``, ``AcceptEncodingNoHeader`` and
97+
``AcceptEncodingInvalidHeader``. These classes are consolidated into
98+
``AcceptEncoding`` with a ``header_state`` attribute for users that need
99+
to know the state of the header.
100+
See https://github.com/Pylons/webob/pull/462
101+
102+
- Remove previously-deprecated ``webob.acceptparse.AcceptEncoding.__iter__``.
103+
See https://github.com/Pylons/webob/pull/462
104+
105+
- ``webob.acceptparse.AcceptEncoding`` methods, ``best_match``, ``quality``,
106+
and ``__contains__`` are now thin wrappers around ``acceptable_offers`` which
107+
modifies their behavior slightly:
108+
109+
- A tuple can no longer be an offer containing server-side quality values.
110+
- An offer will only match a ``*`` clause in a header if it does not match
111+
any other clauses.
112+
- The ``identity`` offer was not properly considered a match unless the
113+
header explicitly it excluded via ``*;q=0`` or ``identity;q=0``.
114+
115+
See https://github.com/Pylons/webob/pull/462
116+
87117
Experimental Features
88118
~~~~~~~~~~~~~~~~~~~~~
89119

docs/api/webob.txt

+4-16
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,10 @@ methods:
4141
acceptable_offers, best_match, quality
4242

4343
.. autoclass:: AcceptEncoding
44-
:members: parse
45-
46-
.. autoclass:: AcceptEncodingValidHeader
47-
:members: parse, header_value, parsed, __init__, __add__, __bool__,
48-
__contains__, __iter__, __radd__, __repr__, __str__,
49-
acceptable_offers, best_match, quality
50-
51-
.. autoclass:: AcceptEncodingNoHeader
52-
:members: parse, header_value, parsed, __init__, __add__, __bool__,
53-
__contains__, __iter__, __radd__, __repr__, __str__,
54-
acceptable_offers, best_match, quality
55-
56-
.. autoclass:: AcceptEncodingInvalidHeader
57-
:members: parse, header_value, parsed, __init__, __add__, __bool__,
58-
__contains__, __iter__, __radd__, __repr__, __str__,
59-
acceptable_offers, best_match, quality
44+
:members:
45+
parse, header_value, parsed, header_state, __init__, __add__,
46+
__bool__, __radd__, __repr__, __str__, __contains__, copy,
47+
acceptable_offers, best_match, quality
6048

6149
.. autoclass:: AcceptLanguage
6250
:members: parse

0 commit comments

Comments
 (0)