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

remove deprecated Content-Transfer-Encoding from multipart post headers #1762

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mtrna
Copy link

@mtrna mtrna commented Jan 5, 2024

motivation:

This PR fixes a problem I stumbled upon: rest-assured requests are rejected by receiver because of invalid header in multipart post.

According to https://datatracker.ietf.org/doc/html/rfc7578#section-4.7 senders SHOULD NOT generate any parts with a Content-Transfer-Encoding header field.

sources:

compare/contrast:

cURL 7.68.0 for -F attachments=@attachment.txt sends e.g.:

Content-Disposition: form-data; name="attachments"; filename="attachment.txt"
Content-Type: text/plain

test

rest-assured 5.4.0 for .multiPart("attachments", new File("attachment.txt"), "text/plain") without fix sends e.g.:

Content-Disposition: form-data; name="attachments"; filename="attachment.txt"
Content-Type: text/plain
Content-Transfer-Encoding: binary

test

rest-assured 5.4.0 with this fix sends e.g.:

Content-Disposition: form-data; name="attachments"; filename="attachment.txt"
Content-Type: text/plain

test

@mtrna
Copy link
Author

mtrna commented Jan 18, 2024

@johanhaleby any suggestions how to steer the fix to the next release? :)

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.

None yet

1 participant