Allow wildcards to be used when comparing a MIMEAccept against an offer #185

Merged
merged 2 commits into from Jan 29, 2016

Conversation

Projects
None yet
2 participants
@ltvolks
Contributor

ltvolks commented Jan 14, 2015

Primary motivation is to address Pylons/pyramid#1407, which would enable usage of wildcards as an accept predicate:

@view_config(accept='text/*')
def view(request):
    ...

Webob.acceptparse.MIMEAccept now supports the following, where previously an exception was raised:

>>> accept = MIMEAccept('text/html')
>>> 'text/*' in accept
True
>>> '*/html' in accept
True
>>> '*' in accept
True
@bertjwregeer

This comment has been minimized.

Show comment
Hide comment
@bertjwregeer

bertjwregeer Mar 23, 2015

Member

Would you be so kind as to add some extra tests that would add coverage for the changes, that would be fantastic.

Member

bertjwregeer commented Mar 23, 2015

Would you be so kind as to add some extra tests that would add coverage for the changes, that would be fantastic.

ltvolks added some commits Sep 7, 2014

Allow wildcards to be used when comparing a MIMEAccept against an offer
- Use list comprehension instead of map for minor performance gain in
  ``MIMEAccept.parse``
- Fixes #155
@ltvolks

This comment has been minimized.

Show comment
Hide comment
@ltvolks

ltvolks Mar 23, 2015

Contributor

Here you go... Curiously, webob.util only shows 91% coverage against master when I run coverage locally, but Travis seems happy enough.

Contributor

ltvolks commented Mar 23, 2015

Here you go... Curiously, webob.util only shows 91% coverage against master when I run coverage locally, but Travis seems happy enough.

@bertjwregeer

This comment has been minimized.

Show comment
Hide comment
@bertjwregeer

bertjwregeer Apr 1, 2015

Member

I'll work on any other coverage issues once I get this pulled in, thanks for updating this PR with tests. :-)

Member

bertjwregeer commented Apr 1, 2015

I'll work on any other coverage issues once I get this pulled in, thanks for updating this PR with tests. :-)

@bertjwregeer bertjwregeer added this to the Version 1.6 milestone Dec 29, 2015

@bertjwregeer bertjwregeer merged commit e51a608 into Pylons:master Jan 29, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@pyup-bot pyup-bot referenced this pull request in tracim/tracim Nov 3, 2017

Closed

Update webob to 1.7.3 #434

@pyup-bot pyup-bot referenced this pull request in DemocracyClub/yournextrepresentative Jan 26, 2018

Closed

Update webob to 1.7.4 #407

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment