Skip to content

Only trim spaces and tabs around header parameters - #364

Merged
Kludex merged 1 commit into
mainfrom
trim-only-spaces-and-tabs
Nov 1, 2026
Merged

Kludex merged 1 commit into
mainfrom
trim-only-spaces-and-tabs

Conversation

@Kludex

@Kludex Kludex commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

parse_options_header trimmed parameter names and values with strip(), rstrip() and lstrip() without arguments. Those remove all Unicode whitespace, and because the header is decoded as latin-1, the bytes 0xA0 and 0x85 count as whitespace too. Whitespace around a header parameter is only a space or a tab (RFC 9110 §5.6.3).

Header Before After
form-data; name=voil\xc3\xa0 name is voil\xc3 name is voil\xc3\xa0
form-data; name="a";\xa0filename="a.txt" Has filename \xa0filename isn't filename, so the part is a field
multipart/form-data; boundary=XX\xa0 Boundary is XX Boundary is XX\xa0

Spaces and tabs are still trimmed, and quoted values are unchanged.

AI Disclaimer

This PR was developed with the assistance of either Claude or Codex. I've reviewed and verified the changes.

View guided diff

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-01T13:08:53.195420Z 77eaf8c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@codspeed

codspeed Bot commented Nov 1, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 5 untouched benchmarks


Comparing trim-only-spaces-and-tabs (77eaf8c) with main (70297b7)

Open in CodSpeed

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

View guided diff | Re-trigger cubic

@Kludex
Kludex merged commit 6cebfd8 into main Nov 1, 2026
14 checks passed
@Kludex
Kludex deleted the trim-only-spaces-and-tabs branch November 1, 2026 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant