webextension reports wrong HTTP method after 303 redirect
Categories
(WebExtensions :: Request Handling, defect, P3)
Tracking
(firefox131 fixed)
Tracking | Status | |
---|---|---|
firefox131 | --- | fixed |
People
(Reporter: binarynoise, Assigned: robwu)
References
Details
(Whiteboard: [addons-jira])
Attachments
(3 files)
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0
Steps to reproduce:
I created an extension that uses webRequest to listen for HTTP traffic.
Actual results:
- I submit a form (HTTP POST)
- The server accepts the form and sends 303 (to the same url)
- I receive onBeforeRedirect with the new url
- Firefox follows the redirect to the url via GET
- subsequent callbacks (like onHeadersReceived) still report HTTP POST
Expected results:
The callbacks should have GET as method after the redirect.
Comment 1•3 months ago
|
||
The Bugbug bot thinks this bug should belong to the 'WebExtensions::Untriaged' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Reporter | ||
Comment 2•3 months ago
|
||
Additional info:
- this happens on desktop and android.
- The network log in the developer tools correctly show the GET request.
- I use "manifest_version": 2
Reporter | ||
Comment 3•3 months ago
|
||
Assignee | ||
Comment 4•3 months ago
|
||
To fix this, I think that we should add a call to ClearCachedMethodValue
at https://searchfox.org/mozilla-central/rev/5756c5a3dea4f2896cdb3c8bb15d0ced5e2bf690/toolkit/components/extensions/webrequest/ChannelWrapper.cpp#200
Would also be nice to confirm that there are no other "Cached" entries that are affected by this kind of bug.
https://searchfox.org/mozilla-central/source/dom/chrome-webidl/ChannelWrapper.webidl
As a work-around, assume that the method is GET when you observe a HTTP 303 redirect.
Updated•3 months ago
|
Assignee | ||
Comment 5•3 months ago
|
||
Assignee | ||
Comment 6•3 months ago
•
|
||
Also clear the cached canModify flag for completeness.
This does not change any behavior in practice, but is more accurate.
Comment 7•2 months ago
|
||
There are some r+ patches which didn't land and no activity in this bug for 2 weeks.
:robwu, could you have a look please?
If you still have some work to do, you can add an action "Plan Changes" in Phabricator.
For more information, please visit BugBot documentation.
Assignee | ||
Comment 8•2 months ago
|
||
I'm waiting for a review of the patch in bug 1909270 before landing the patch stack.
Comment 10•2 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/7a11746b9949
https://hg.mozilla.org/mozilla-central/rev/f444f3e0955c
Description
•