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 1 commit into from Dec 5, 2017

match header option value with single quotes #1208

merged 1 commit into from Dec 5, 2017


Copy link

@davidism davidism 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

`*=` only matches when followed by encoding
comment regex using verbose mode and group names
fixes #1091, fixes #1177
@davidism davidism added this to the 0.13 milestone 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 was marked as off-topic.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
2 participants