Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

match header option value with single quotes #1208

Merged
merged 1 commit into from Dec 5, 2017

Conversation

Projects
None yet
2 participants
@davidism
Copy link
Member

commented Dec 4, 2017

Move the *= into the match for extended notation, instead of before it.

The regex became slightly stricter and no longer matches *= if it's not followed by a language and encoding. For example, filename*=test.txt no longer matches (although it was never valid and nothing should have been sending that). Allowing that (against spec) and also fixing the quoting issue would require a different solution.

fixes #1091, fixes #1177

match header option value with single quotes
`*=` only matches when followed by encoding
comment regex using verbose mode and group names
fixes #1091, fixes #1177

@davidism davidism added the standards label Dec 4, 2017

@davidism davidism added this to the 0.13 milestone Dec 4, 2017

@davidism davidism requested review from ThiefMaster and untitaker Dec 4, 2017

'form-data; name="file"; filename="t\'es\'t.txt"'
) == ('form-data', {'name': 'file', 'filename': "t'es't.txt"})
assert http.parse_options_header(
'form-data; name="file"; filename*=UTF-8\'\'"\'🐍\'.txt"'

This comment has been minimized.

Copy link
@ThiefMaster

ThiefMaster Dec 5, 2017

Member

OMG SNEK! 🐍

@davidism davidism merged commit a1759a8 into pallets:master Dec 5, 2017

1 check passed

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

@davidism davidism deleted the davidism:header-option-quotes branch Dec 5, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.