Closed Bug 1185293 Opened 5 years ago Closed 4 years ago

"Save All As HAR" fails with TypeError: file.responseHeaders is undefined @ har-builder.js (also file.responseContent)

Categories

(DevTools :: Netmonitor, defect)

defect
Not set

Tracking

(firefox42 fixed)

RESOLVED FIXED
Firefox 42
Tracking Status
firefox42 --- fixed

People

(Reporter: asqueella, Assigned: Honza)

References

Details

Attachments

(1 file)

In a new profile with the current Nightly:
1. Open Tools -> Web Developer -> Network (Cmd+Alt+Q)
2. Go to https://groups.google.com/forum/#!topic/firebug/u3nbmQfiMHk
3. Wait until the page finishes loading (at ~37 requests)
4. Right click the network pane, select "Save All As HAR"
5. Reload the page (Cmd+R)
6. Wait until the page finishes loading (at ~37 requests)
7. Right click the network pane, select "Save All As HAR"

At step 4 the HAR file is generated correctly.
At step 7 the HAR file is not created, the browser console says 
> TypeError: file.responseHeaders is undefined
> resource:///modules/devtools/netmonitor/har/har-builder.js:295:5
> 
>  buildResponse: function(file) {
>    [...]
> 
>    response.content = this.buildContent(file);
> >> response.redirectURL = findValue(file.responseHeaders.headers, "Location"); 

Also I see a similar problem, which I did not try to reproduce with a clean profile on gmail.com:

> TypeError: file.responseContent is undefined
> resource:///modules/devtools/netmonitor/har/har-builder.js:313:1
> 
>   buildContent: function(file) {
>    [...]
>    if (!this._options.includeResponseBodies ||
> >>     file.responseContent.contentDiscarded) {
Patch attached.

@jryans: it's just a few changes to avoid NPE when the response is not available. It would be great to have this landed yet in 42 (this week), thanks!

Honza
Assignee: nobody → odvarko
Status: NEW → ASSIGNED
Attachment #8643761 - Flags: review?(jryans)
https://hg.mozilla.org/mozilla-central/rev/877a69dd3bfe
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 42
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.