Closed Bug 879782 Opened 8 years ago Closed 8 years ago

POST data is sometimes not displayed in the Network Monitor details pane

Categories

(DevTools :: Netmonitor, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 24

People

(Reporter: tetsuharu, Assigned: vporof)

References

()

Details

Attachments

(1 file, 1 obsolete file)

No description provided.
POST bodies should already be displayed in the Response tab. Please post some reliable STRs so that this bug can be reproduced. Then reopen.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → INVALID
(In reply to Victor Porof [:vp] from comment #1)
> POST bodies should already be displayed in the Response tab. Please post
> some reliable STRs so that this bug can be reproduced. Then reopen.

I'm sorry. My report was very bad.

Step to reproduce is: 
1. Open Net Monitor
2. Send form data with using post method on any forms.
3. There is no pane to display sent form data.

Victor, could you reopen this bug with these STR?
Summary: Need to display post body on devtools net monitor → Need to display sent form data with "post" method on devtools net monitor
(In reply to Tetsuharu OHZEKI [:saneyuki_s] from comment #2)
> 
> Step to reproduce is: 
> 1. Open Net Monitor
> 2. Send form data with using post method on any forms.
> 3. There is no pane to display sent form data.
> 

I do believe you, but I'm afraid those STR are still a bit gappy :) POST data should both be handled in x-www-form-urlencoded *and* multipart/form-data form. And there are also tests for this, so I'd assume nothing broke in the meantime.

Is there any URL I could look at? Can you provide a minimal/reduced test case?
(In reply to Victor Porof [:vp] from comment #3)
> Is there any URL I could look at? Can you provide a minimal/reduced test
> case?

I think the testcase URL which uses "x-www-form-urlencoded" is https://accounts.google.com/ServiceLogin . Its login form is a common form using POST method.

But I don't know the one which uses multipart/form-data. We (I) need to write simple test case.
(In reply to Tetsuharu OHZEKI [:saneyuki_s] from comment #4)
> (In reply to Victor Porof [:vp] from comment #3)
> > Is there any URL I could look at? Can you provide a minimal/reduced test
> > case?
> 
> I think the testcase URL which uses "x-www-form-urlencoded" is
> https://accounts.google.com/ServiceLogin . Its login form is a common form
> using POST method.

Ok, I can reproduce with https://accounts.google.com/ServiceLoginAuth. Weird.
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
Summary: Need to display sent form data with "post" method on devtools net monitor → POST data is sometimes not displayed in the Network Monitor details pane
Priority: -- → P2
Where would we be without malformed shit...

Content-Type: application/x-www-form-urlencoded\r\nContent-Length: 596\r\n\r\ndsh=-4911037691087227317&GALX=bjaEzTQe9Jw&pstMsg=1&dnConn=&checkConnection=youtube%3A309%3A1&checkedDomains=youtube&timeStmp=&secTok=&_utf8=%E2%98%83&bgresponse=%21A0ITLl044Bke6kTFJ2J-YkCNWQIAAAAcUgAAAAgqAPPMe4wzB5xLsffk2QLJHmPZy6qSASl0gE8XXbSHkNg8VXMVziaYuHBdjTbGScpxAfGe3AfW2qHB1sY5T1tasCsqUDBUo1xTl2GeB5IbCat0bfqEOOOaF6bKE-8EnE5n2CqTMNHP-JJJVuRQf1o5PONMkvo4l1llFDVnvFVGwcDOpdFe0iQwyDp2B1g7Zc-dqJxQGHiTsO2buxrnzJLSFzCUgNxrSG2grNR6hm2ESM0m3lBZggpGbfrRJocKIetZjVsrDFEdPm8chWdyrY30kJ2YMw6b1-_qkWO_vstIXp5ypOA-GK36R2lX9GILBp5Nng4XWIs&Email=xxx&Passwd=xxx&signIn=Sign+in&PersistentCookie=yes&rmShown=1
Assignee: nobody → vporof
Status: REOPENED → ASSIGNED
Attached file testcase about xhr (obsolete) —
This is the testcase about XHR post. This has 2 patterns:
* send normal strings.
* send FormData which contains Blob.

The current net monitor can display sent data in "Params" pane. But it's roughly.
(In reply to Tetsuharu OHZEKI [:saneyuki_s] from comment #7)
> 
> The current net monitor can display sent data in "Params" pane. But it's
> roughly.

What do you mean? It displays those just fine.

* For the second button: multipart/form-data is never displayed in a structured tree, because it's not json. There is a bug on file to make this look prettier (bug 812616), but definitely not in a variables view or anything else that may resemble json. Firebug displays them in the exact same way. Chrome is really confused and displays nothing.

* The first button simply does a plain XHR request with a payload, no x-www-form-urlencoded header is set, and it's also not multipart/form-data. The payload is displayed just fine in the Params tab.

So what exactly do you mean by "roughly"?

Anyway, none of those test cases touch what's happening in https://accounts.google.com/ServiceLoginAuth, where there are multiple param groups separated by line feeds and carriage returns. But that's ok, I could reproduce this just fine and I'm writing a fix for it at the moment :)
Attachment #758642 - Attachment is obsolete: true
I meant that we may be able to polish its display on this bug.
I apologize my comment has a misreading and I should comment it on the other bug.

I'll watch bug 812616.
Attached patch v1Splinter Review
Attachment #759040 - Flags: review?(rcampbell)
Comment on attachment 759040 [details] [diff] [review]
v1

Review of attachment 759040 [details] [diff] [review]:
-----------------------------------------------------------------

::: browser/devtools/netmonitor/netmonitor-view.js
@@ +1541,5 @@
> +      let cType = aHeadersResponse.headers.filter(({ name }) => name == "Content-Type")[0];
> +      let cString = cType ? cType.value : "";
> +      if (cString.contains("x-www-form-urlencoded") ||
> +          aString.contains("x-www-form-urlencoded")) {
> +        let formDataGroups = aString.split(/\r\n|\n|\r/);

is this what we've become?

::: browser/devtools/netmonitor/test/browser_net_post-data-01.js
@@ +99,2 @@
>          if (aType == "urlencoded") {
>            checkVisibility("params");

whitespace change?
Attachment #759040 - Flags: review?(rcampbell) → review+
(In reply to Rob Campbell [:rc] (:robcee) from comment #12)
> 
> ::: browser/devtools/netmonitor/test/browser_net_post-data-01.js
> @@ +99,2 @@
> >          if (aType == "urlencoded") {
> >            checkVisibility("params");
> 
> whitespace change?

Just file renamed. Apparently splinter doesn't know how to properly let you know about this.
https://hg.mozilla.org/mozilla-central/rev/c236d75db916
Status: ASSIGNED → RESOLVED
Closed: 8 years ago8 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 24
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.