Skip to content

Handle transport padding after multipart boundaries - #363

Merged
Kludex merged 1 commit into
mainfrom
handle-boundary-padding
Nov 1, 2026
Merged

Kludex merged 1 commit into
mainfrom
handle-boundary-padding

Conversation

@Kludex

@Kludex Kludex commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

MultipartParser didn't recognise a delimiter with spaces or tabs between the boundary and its CRLF. The delimiter line and the next part were delivered as data of the part already open, so two parts came out as one.

RFC 2046 §5.1.1 allows this transport padding and says receivers must be able to handle it. Werkzeug, Django and the standard library email parser all return two parts for these requests.

Line after a part Before After
--boundary \t\r\n Data New part
--boundary foo Data MultipartParseError
--boundaryX Data Data

A line starting with the boundary can't be part data under the RFC, so a boundary followed by spaces or tabs and then anything other than CRLF now raises an error. A padded opening boundary is still rejected, as it is today.

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-01T07:10:46.319683Z beff395 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 handle-boundary-padding (beff395) with main (66e4fa4)

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 enabled auto-merge (squash) November 1, 2026 07:12
@Kludex
Kludex merged commit 17334ce into main Nov 1, 2026
14 checks passed
@Kludex
Kludex deleted the handle-boundary-padding branch November 1, 2026 07: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