Open Bug 1935363 Opened 1 year ago Updated 1 year ago

multipart boundary is being converted to lower-case in test_FormData.html

Categories

(Core :: DOM: Networking, defect, P3)

defect

Tracking

()

People

(Reporter: omansfeld, Unassigned)

Details

(Whiteboard: [necko-triaged])

We changed the way the boundary value for multipart/form-data requests is being generated in Bug 1931331 to ----GeckoFormBoundary[some hex number] which lead to dom/html/test/test_FormData.html failling.

This was due to the boundary value being converted to lower case in the test logic which then was in conflict with the mixed-case boundary in the request body, see comment#7 and onward in Bug 1931331.

We opted to generate the boundary to be all lowercase so we're not blocked by this and landed the bug in the meantime.

To reproduce change the boundary string here to include an upper case letter and run ./mach mochitest dom/html/test/test_FormData.html. Maybe also dump() requestBody and contentTypeParams.boundary here to see the mixed-case and converted strings in the log.

Expected results: The boundary value should be case sensitive.
Actual result: The boundary value is converted to lower case and the test fails.

I think this is an issue with the worker XMLHttpRequest implementation, it uses a StreamBlobImpl to send the payload to the main thread (see https://searchfox.org/mozilla-central/rev/5b93d2870ab36ba9cfa144fa7518d54e5439caa9/dom/xhr/XMLHttpRequestWorker.cpp#1715-1717), but Blobs lowercase the passed in content type (which is spec-compliant). The specs don't use a Blob for this though.

Component: DOM: Core & HTML → DOM: Networking
Severity: -- → S3
Priority: -- → P3
Whiteboard: [necko-triaged][necko-priority-new]
Severity: S3 → S4
Whiteboard: [necko-triaged][necko-priority-new] → [necko-triaged]
You need to log in before you can comment on or make changes to this bug.