Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd CRLF to encoded multipart form data #24670
Conversation
highfive
commented
Nov 6, 2019
|
Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @Manishearth (or someone else) soon. |
highfive
commented
Nov 6, 2019
|
Heads up! This PR modifies the following files:
|
|
Review ping @Manishearth. |
|
Can we file a bug on the HTML spec about this? I'm wary of landing unspecced behavior without having a bug on file. |
|
r=me once we have such a bug |
|
@bors-servo r+ I'll file a bug once this lands |
|
|
Add CRLF to encoded multipart form data <!-- Please describe your changes on the following line: --> Some (3) WPT tests were failing because they expected the body for a multipart form data response to end with a CRLF. So I updated encode_multipart_form_data to add the missing terminator. Looking at the corresponding spec (https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#multipart%2Fform-data-encoding-algorithm) and RFC (https://tools.ietf.org/html/rfc7578), I couldn't find anything mentioned about this detail. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors <!-- Either: --> - [x] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
|
|
|
|
As a sanity check, I'm trying to figure out a way to run this failed test in Firefox. I'll ask for help if I get stuck. |
|
You can run stuff online at https://wpt.fyi
…On Tue, Nov 26, 2019, 9:20 PM Graham Lowe ***@***.***> wrote:
As a sanity check, I'm trying to figure out a way to run this failed test
in Firefox. I'll ask for help if I get stuck.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#24670?email_source=notifications&email_token=AAMK6SF7ZGZFNJISTQMJ2MTQVX7QRA5CNFSM4JJOP46KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFIKK2I#issuecomment-558933353>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMK6SG4F224FHTDWUX7JTLQVX7QRANCNFSM4JJOP46A>
.
|
|
Ok, there's a bunch of issues I've discovered:
However, I read
So it would seem that browsers don't strictly follow the rfc. I'm happy to withdraw this PR or keep proceeding. Let me know what you think. Thanks! |
| @@ -20,8 +20,8 @@ def main(request, response): | |||
|
|
|||
| boundary = content_type[1].strip("boundary=") | |||
|
|
|||
| body = "--" + boundary + "\r\nContent-Disposition: form-data; name=\"file-input\"; filename=\"upload.txt\"" | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
glowe
Nov 29, 2019
•
Author
I shouldn't have committed this change, but it's the version of the file that "passes" in Chrome, Safari, and Firefox. The reason the filename is empty, the contents are empty, and the Content-Type is application/octet-stream is because the test actually degrades to submitting a form with an empty file input in those browsers. This is because the test relies on a servo specific testing extension on the file input object called selectFiles, which doesn't work in the other browsers.
I'll replace this commit with the proper changes to have this test working in Servo in a few moments.
This comment has been minimized.
This comment has been minimized.
glowe
Nov 29, 2019
Author
Ok. Dropped the commit that had the filename change. The only change in this file will be the addition of the \r\n now.
|
r=me , please squash! |
Some WPT tests were failing because they expected the body for a multipart form data response to end with a CRLF. So I updated encode_multipart_form_data to add the missing terminator.
Squashed! Thanks! |
|
@bors-servo r=Manishearth |
|
|
Add CRLF to encoded multipart form data <!-- Please describe your changes on the following line: --> Some (3) WPT tests were failing because they expected the body for a multipart form data response to end with a CRLF. So I updated encode_multipart_form_data to add the missing terminator. Looking at the corresponding spec (https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#multipart%2Fform-data-encoding-algorithm) and RFC (https://tools.ietf.org/html/rfc7578), I couldn't find anything mentioned about this detail. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors <!-- Either: --> - [x] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
|
|
|
Failures appears to be unrelated to this change:
|
|
@bors-servo retry |
Add CRLF to encoded multipart form data <!-- Please describe your changes on the following line: --> Some (3) WPT tests were failing because they expected the body for a multipart form data response to end with a CRLF. So I updated encode_multipart_form_data to add the missing terminator. Looking at the corresponding spec (https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#multipart%2Fform-data-encoding-algorithm) and RFC (https://tools.ietf.org/html/rfc7578), I couldn't find anything mentioned about this detail. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors <!-- Either: --> - [x] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
|
|
glowe commentedNov 6, 2019
Some (3) WPT tests were failing because they expected the body for a multipart form data response to end with a CRLF. So I updated encode_multipart_form_data to add the missing terminator.
Looking at the corresponding spec (https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#multipart%2Fform-data-encoding-algorithm) and RFC (https://tools.ietf.org/html/rfc7578), I couldn't find anything mentioned about this detail.
./mach build -ddoes not report any errors./mach test-tidydoes not report any errors