mirror of
https://github.com/sprockets/sprockets.mixins.mediatype.git
synced 2024-12-28 03:00:24 +00:00
Support ietfparse 1.5.1
ietfparse 1.5.1 broke sprockets.mixins.media_type as it introduced the splitting of content suffix from content subtype. This commit fixes that.
This commit is contained in:
parent
723ed25edb
commit
30c87225c0
2 changed files with 7 additions and 1 deletions
|
@ -1,2 +1,2 @@
|
|||
ietfparse>=1.4,<1.5
|
||||
ietfparse>=1.5.1,<2
|
||||
tornado>=5,<6
|
||||
|
|
|
@ -317,6 +317,9 @@ class ContentMixin:
|
|||
acceptable, settings.available_content_types)
|
||||
self._best_response_match = '/'.join(
|
||||
[selected.content_type, selected.content_subtype])
|
||||
if selected.content_suffix is not None:
|
||||
self._best_response_match = '+'.join(
|
||||
[self._best_response_match, selected.content_suffix])
|
||||
except errors.NoMatch:
|
||||
self._best_response_match = settings.default_content_type
|
||||
|
||||
|
@ -340,6 +343,9 @@ class ContentMixin:
|
|||
settings.default_content_type))
|
||||
content_type = '/'.join([content_type_header.content_type,
|
||||
content_type_header.content_subtype])
|
||||
if content_type_header.content_suffix is not None:
|
||||
content_type = '+'.join([content_type,
|
||||
content_type_header.content_suffix])
|
||||
try:
|
||||
handler = settings[content_type]
|
||||
except KeyError:
|
||||
|
|
Loading…
Reference in a new issue