Skip to content
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

Use random value for multipart/form-data boundary. #1464

Merged
merged 1 commit into from
May 18, 2020
Merged

Use random value for multipart/form-data boundary. #1464

merged 1 commit into from
May 18, 2020

Conversation

Trellmor
Copy link
Contributor

Description

The request body might contain the previous, fixed value for FormBoundary.
This will cause a server to split the body on the wrong boundaries.

For example trying to post this file which already contains a boundary will generate an invalid request.

`-------------------------------28947758029299
Content-Disposition: form-data; name="somefile_REC.pdf"; filename="somefile_REC.pdf"
Content-Type: application/x-gzip

%PDF-1.4
[...] truncated
%%EOF

-------------------------------28947758029299--
`

By using a random value for the boundary collisions like this will be avoided.

Purpose

This pull request is a:

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

The request body might contain the previous, fixed value for FormBoundary.
This will cause a server to split the body on the wrong boundaries.
@alexeyzimarev
Copy link
Member

Cool, thanks!

@alexeyzimarev alexeyzimarev merged commit b0816cc into restsharp:master May 18, 2020
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