Closed Bug 1473220 Opened 6 years ago Closed 6 years ago

"Open in New Tab" under Developer Toolbar\Network doesn't send same content type

Categories

(DevTools :: Netmonitor, defect, P3)

63 Branch
defect

Tracking

(firefox64 fixed)

RESOLVED FIXED
Firefox 64
Tracking Status
firefox64 --- fixed

People

(Reporter: omidmr, Assigned: glowka.tom)

References

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:63.0) Gecko/20100101 Firefox/63.0
Build ID: 20180627222831

Steps to reproduce:

It doesn't work properly if content type of the request is "application/json".

In my test case, I sent "{"email":"email@example.com","password":"text&with&ampersand&in&it!"}" with "application/json" content type.

But when I open it in a new tab, it will send "application/x-www-form-urlencoded" content type which will be interpreted as:

{"email":"email@example.com","password":"text
with
ampersand
in
it!"}
Component: Untriaged → Netmonitor
Product: Firefox → DevTools
This is a follow up for bug 1407515

@Tom: what could be the problem here?

Honza
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(glowka.tom)
Priority: -- → P3
Hey!

So the current implementation of this feature looks very basic, we do not use the content type of the original request when opening the new tab, but explicitly and unconditionally set "application/x-www-form-urlencoded" for any POST request. This is the exact line: https://hg.mozilla.org/mozilla-central/file/tip/devtools/client/netmonitor/src/utils/firefox/open-request-in-tab.js#l33

Maybe we should extend it to support more (any?) content types by utilizing content type from original request? Or at least support the "application/json" case, which this bug is about and seems to be most popular case.

I could take that bug as soon as I have new shape of this feature defined :)
Flags: needinfo?(glowka.tom) → needinfo?(odvarko)
(In reply to Tom Glowka from comment #2)
> Maybe we should extend it to support more (any?) content types by utilizing
> content type from original request?
Yes, I think this is the best way to go.

> I could take that bug as soon as I have new shape of this feature defined :)
Let me know if I should assign it to you.

Thanks,
Honza
Flags: needinfo?(odvarko)
(In reply to Jan Honza Odvarko [:Honza] from comment #3)

> Let me know if I should assign it to you.
I'll be happy to take it. Please do!
Flags: needinfo?(odvarko)
Done, thanks for the help!
Honza
Assignee: nobody → glowka.tom
Status: NEW → ASSIGNED
Flags: needinfo?(odvarko)
Before this change it was hardcoded to "application/x-www-form-urlencoded",
now original type is simply forwarded.
Comment on attachment 9007099 [details]
Use original content-type when opening request in tab in Netmonitor

Jan Honza Odvarko [:Honza] has approved the revision.
Attachment #9007099 - Flags: review+
Keywords: checkin-needed
Pushed by ebalazs@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0661deed0ac4
Use original content-type when opening request in tab in Netmonitor r=Honza
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/0661deed0ac4
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 64
Depends on: 1490092
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: