-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1775501 - multipart boundary should be handled as mixed case, r=k…
…ershaw Since w3c/FileAPI#43 is still open, it is unclear how body.type should work. The current wpts expect some behavior which isn't in the specifications. So, since the situation is very messy in the specifications, the patch is doing a spot fix for boundary handling. It is ugly, but shouldn't change other behavior. Differential Revision: https://phabricator.services.mozilla.com/D150018
- Loading branch information
Olli Pettay
authored and
Olli Pettay
committed
Jul 11, 2022
1 parent
11bd8ec
commit 2a78f9f
Showing
9 changed files
with
95 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
testing/web-platform/tests/fetch/content-type/multipart.window.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// META: title=Ensure capital letters can be used in the boundary value. | ||
setup({ single_test: true }); | ||
(async () => { | ||
const form_string = | ||
"--Boundary_with_capital_letters\r\n" + | ||
"Content-Type: application/json\r\n" + | ||
'Content-Disposition: form-data; name="does_this_work"\r\n' + | ||
"\r\n" + | ||
'YES\r\n' + | ||
"--Boundary_with_capital_letters--\r\n"; | ||
|
||
const r = new Response(new Blob([form_string]), { | ||
headers: [ | ||
[ | ||
"Content-Type", | ||
"multipart/form-data; boundary=Boundary_with_capital_letters", | ||
], | ||
], | ||
}); | ||
|
||
var s = ""; | ||
try { | ||
const fd = await r.formData(); | ||
for (const [key, value] of fd.entries()) { | ||
s += (`${key} = ${value}`); | ||
} | ||
} catch (ex) { | ||
s = ex; | ||
} | ||
|
||
assert_equals(s, "does_this_work = YES"); | ||
done(); | ||
})(); |