Closed Bug 1697292 Opened 3 months ago Closed 22 days ago

The request body parser needs to change to match DOM changes

Categories

(WebExtensions :: Request Handling, task, P2)

task

Tracking

(firefox90 fixed)

RESOLVED FIXED
90 Branch
Tracking Status
firefox90 --- fixed

People

(Reporter: abb, Assigned: abb, NeedInfo)

References

Details

Attachments

(1 file)

Bug 1686765 is changing some details of form serialization, and in particular, it changes the way names and filenames are serialized in multipart/form-data payloads. As they are currently serialized, newlines are converted into spaces, and double quotes are escaped with a backslash. This is being changed to match Chrome's behavior, with newlines (CR and LF) and double quotes being percent-escaped.

This change breaks toolkit/components/extensions/test/mochitest/test_ext_webrequest_upload.html because the WebExtensions code that parses request bodies on webRequest.onBeforeRequest decodes quotes escaped with a backslash but lets percent escapes through. I checked Chrome's behavior here, and it decodes all percent-escapes, not only those produced by the serialization.

Andreu, is there a target release version for this change? Will you be able to update the handling in webRequest[1]?

[1] https://searchfox.org/mozilla-central/rev/aa9a7136835deb0eeba00c62bb50a4a0e2cdea2d/toolkit/components/extensions/webrequest/WebRequestUpload.jsm#396

Flags: needinfo?(abb)

There isn't a target release version, yet at the very least. I'll be fixing the handling in a separate commit in the same Phabricator revision, if that's okay.

Flags: needinfo?(abb)

This will also make the parser compatible with the changes to the multipart/form-data serializer in bug 1686765.

Assignee: nobody → abb
Severity: -- → N/A
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Priority: -- → P2

There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:abb, could you have a look please?
For more information, please visit auto_nag documentation.

Flags: needinfo?(mixedpuppy)
Flags: needinfo?(abb)

The patch for this bug cannot be merged before the one for bug 1686765, which is still waiting for a review.

Flags: needinfo?(abb)
Pushed by opettay@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6daedfe5f8fe
Update the WebExtensions' multipart/form-data parser to match Chrome. r=mixedpuppy
Status: ASSIGNED → RESOLVED
Closed: 22 days ago
Resolution: --- → FIXED
Target Milestone: --- → 90 Branch
You need to log in before you can comment on or make changes to this bug.