Closed Bug 1758361 Opened 2 years ago Closed 2 years ago

The "Network" tab crashes with: TypeError: value.match(...) is null.

Categories

(DevTools :: Netmonitor, defect, P2)

Firefox 97
defect

Tracking

(firefox101 fixed)

RESOLVED FIXED
101 Branch
Tracking Status
firefox101 --- fixed

People

(Reporter: demidov12andrew, Assigned: bomsy, Mentored, NeedInfo)

References

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:97.0) Gecko/20100101 Firefox/97.0

Steps to reproduce:

The "Network" panel had logged some requests.
I selected a PUT request. A side pane was displayed, listing request details, namely headers.
The third group (beside request and response headers), "Request headers from upload stream", could be seen. I did not see it, when the selected request was GET. This group listed... the payload-to-send for some reason...
I clicked the switch that stated "Raw".

Actual results:

Upon clicking "Raw" the "Network" panel crashed with: TypeError: value.match(...) is null.

Expected results:

Probably raw headers of sorts should have been displayed, similar to what happens with request and response headers.
Also, when the switch is set to display nonraw headers, actual headers should probably be displayed instead of the payload-to-send...

The severity field is not set for this bug.
:Honza, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(odvarko)

Thank you for the report!

I managed to reproduce the problem, the stack trace pointed to this location:
renderRow@resource://devtools/client/netmonitor/src/components/request-details/HeadersPanel.js:391:22

Here is a simple test case that can be used to repro the crash:
http://janodvarko.cz/tests/bugzilla/1758361/

Note that "Request headers from upload stream" can be also specified as follows to crash the panel:

  const rawData = [
    "content-type: application/x-www-form-urlencoded\r",
    "\r",
    "\r",
    "content-encoding: gzip-x\r",
  ];

Honza

Mentor: odvarko
Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(odvarko) → needinfo?(demidov12andrew)
Priority: -- → P2
Has STR: --- → yes
Flags: needinfo?(hmanilla)

OK, this is weird.
The test above (at http://janodvarko.cz/tests/bugzilla/1758361/ ) does result in a logged request -- but!
Clicking the "Request" panel further results in another: TypeError: arr is null!
The original steps-to-reproduce still lead to the original error.

This time User-Agent is Firefox 98: "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0".
Reproducible in earlier versions?..

Also I used PUT, not POST, when I spotted the bug first. Apparently, bug happens, whenever payload is sent, no matter the method...
But with POST -- request headers are shown ("content-type: application/x-www-form-urlencoded" in the test), while with my PUT it showed payload-to-send.
The error is still the same, as reported, though. Happens on toggling to raw headers.

Additional tests needed?..

(In reply to demidov12andrew from comment #3)

Additional tests needed?..

Could you please provide a simple test case we could use to reproduce your STRs on our machine? That would be great help, thank you.
(something like I did for my STRs)

(In reply to Jan Honza Odvarko [:Honza] (always need-info? me) from comment #4)

(In reply to demidov12andrew from comment #3)

Additional tests needed?..

Could you please provide a simple test case we could use to reproduce your STRs on our machine? That would be great help, thank you.
(something like I did for my STRs)

Gee, how do I even make such a case?..
But wait... The page above ( http://janodvarko.cz/tests/bugzilla/1758361/ ) could be used, because I visited it, when this additional error was discovered.
The instructions should be followed:

Open developer Toolbox and select the Network panel
Click this button to execute test request
Select the request to inspect Headers

-- but the next step differs and yields that additional error:

Check out the Request panel, the panel crashes


I'll see about a simple test with a PUT. I could set up a local server, but that's all I could do. Should probably share my HTML...

Assignee: nobody → hmanilla
Flags: needinfo?(hmanilla)
Attachment #9271635 - Attachment description: Bug 1758361 - [devtools] Fix crash when viewing request headers from upload stream → Bug 1758361 - [devtools] Fix crash when viewing request headers from upload stream r=nchevobbe
Pushed by hmanilla@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/368723bbbeae
[devtools] Cleanup post data tests r=nchevobbe
https://hg.mozilla.org/integration/autoland/rev/a36b3afe668d
[devtools] Fix crash when viewing request headers from upload stream r=nchevobbe
Regressions: 1764894
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 101 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: