Repository navigation
Conversation
Header parameter parsing currently skips parameters when a semicolon is followed by a horizontal tab, dropping `boundary`, `name`, or `filename`. Accept SP and HTAB in that position, as specified by [RFC 9110 §5.6.3](https://www.rfc-editor.org/rfc/rfc9110.html#section-5.6.3) and [§5.6.6](https://www.rfc-editor.org/rfc/rfc9110.html#section-5.6.6). This lets strict form parsing read the same fields and uploads with tab-separated parameters as with space-separated parameters. The change keeps the existing handling around `=` and adds tests for boundary parsing, field names, filenames, and whitespace outside SP/HTAB.
Owner
|
Please elaborate why this is needed. Unless there is a HTTP client or library that actually emits headers with tabs instead of spaces (and breaks a SHOULD rule by doing so), I see no reason implementing random design mistakes from the past. |
Author
|
Thanks for reviewing this. My limited source review and public issue searches did not find a verifiable HTTP multipart client that automatically emits a tab immediately after the semicolon on the same header line. Without that evidence, I'll close this PR. Appreciate your time. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Header parameter parsing currently skips parameters when a semicolon is followed by a horizontal tab, dropping
boundary,name, orfilename. Accept SP and HTAB in that position, as specified by RFC 9110 §5.6.3 and §5.6.6. This lets strict form parsing read the same fields and uploads with tab-separated parameters as with space-separated parameters. The change keeps the existing handling around=and adds tests for boundary parsing, field names, filenames, and whitespace outside SP/HTAB.Run this example from the repository root with Python 3.10 or later:
Before (
5fd5a1a6ce05262181aa18b02e07e426491f7a0c):After:
Validation:
python -m pytest -ra -qon macOS arm64 with CPython 3.12.13: 139 passed, 38 subtests passed. The unmodified suite passes before the change; the added tests expose 10 failing HTAB-related subtests before the fix. Linux and Python 3.10, 3.11, 3.13, and 3.14 were not rerun locally. The documentation and distribution CI jobs were not rerun locally.AI disclosure: Codex assisted with part of the code and this description.