fix: skip whitespace-only segments in parse_mimetype#13024
Draft
muhamedfazalps wants to merge 5 commits into
Draft
fix: skip whitespace-only segments in parse_mimetype#13024muhamedfazalps wants to merge 5 commits into
muhamedfazalps wants to merge 5 commits into
Conversation
parse_mimetype: change 'if not item' to 'if not item.strip()' to skip whitespace-only segments after semicolons, preventing spurious empty-key parameters. DeflateBuffer.feed_data: add early return on empty chunks to prevent IndexError when sniffing the CM byte of the zlib header. Fixes aio-libs#13009 Fixes aio-libs#12994
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #13024 +/- ##
==========================================
- Coverage 98.96% 98.84% -0.13%
==========================================
Files 131 129 -2
Lines 48156 48112 -44
Branches 2499 2489 -10
==========================================
- Hits 47656 47554 -102
- Misses 376 430 +54
- Partials 124 128 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
This reverts commit 4d4601f.
Change 'if not item' to 'if not item.strip()' to skip whitespace-only segments after semicolons, preventing spurious empty-key parameters. Fixes aio-libs#13009
Merging this PR will not alter performance
Comparing Footnotes
|
After semicolons, whitespace-only segments produce spurious empty-key parameters. Use .strip() to skip them. Fixes aio-libs#13009
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.
What is the change
Fixed to skip whitespace-only segments after semicolons, preventing spurious empty-key parameters.
Why is the change needed
produces instead of , polluting parameter dicts.
Checklist
Drafted with Claude Code; reviewed by muhamedfazalps.