Skip to content

Fix bad request for multipart form data with boundary split #2159

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

Merged
merged 2 commits into from
Jun 24, 2025

Conversation

herbrechtsmeier
Copy link
Contributor

Fix a bad request (400) response for multipart form data requests with a large header which leads to a split inside the boundary because of the read buffer size inside the SocketStream class. The parse function inside the MultipartFormDataParser wrongly erase the receive buffer if it doesn't find the boundary inside the buffer during first call.

@yhirose
Copy link
Owner

yhirose commented Jun 23, 2025

@herbrechtsmeier could you please resolve build errors, first? :)

@herbrechtsmeier
Copy link
Contributor Author

Sorry, I didn't realize I was using a private function because CMake/gcc built and ran the tests.

Add a test for multipart form data requests with a large header which
leads to a split inside the boundary because of the read buffer size
inside the SocketStream class.
Fix a bad request (400) response for multipart form data requests with
a large header which leads to a split inside the boundary because of the
read buffer size inside the SocketStream class. The parse function
inside the MultipartFormDataParser wrongly erase the receive buffer if
it doesn't find the boundary inside the buffer during first call.
@yhirose yhirose merged commit de5a255 into yhirose:master Jun 24, 2025
17 of 23 checks passed
@yhirose
Copy link
Owner

yhirose commented Jun 24, 2025

@herbrechtsmeier thanks for your fine contribution!

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.

2 participants