Closed Bug 1007299 Opened 11 years ago Closed 5 years ago

JSON data not shown in response pane when served with HTTP status 500 and MIME type text/json

Categories

(DevTools :: Netmonitor, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: hsteen, Unassigned)

References

(Blocks 1 open bug, )

Details

Attachments

(1 file)

Attached file json500.php
Demo: http://hallvord.com/temp/moz/bug/json500.php 

This URL sends a 500 Server Error response with JSON data (based on an actual service sending JSON data describing the details of the server error). Try to load it with the network pane of the developer tools open, select the request and click the "Response" tab to inspect it.

Result: JSON parse error. No data to inspect.

This is probably a deeper bug, body being dropped somewhere due to the error status.
Severity: normal → minor
Priority: -- → P4
It also only happens when using the MIME type text/json instead of the recommended application/json
Severity: minor → trivial
Priority: P4 → P5
Summary: JSON data not shown in response pane when served with HTTP status 500 → JSON data not shown in response pane when served with HTTP status 500 and MIME type text/json
It seems Firefox is actually refusing to show the response in this case. I'm noticing completely different results in Chrome vs. Firefox.

Chrome: {"status":"500 server error", "foo":"bar"} displayed in the page.
Firefox: File not found. Firefox can't find the file at http://hallvord.com/temp/moz/bug/json500.php etc.

Indeed, this might be a deeper problem.
Severity: trivial → normal
OS: Windows 8.1 → All
Priority: P5 → P3
Hardware: x86_64 → All
I believe bug 1209658 will fix this, for this particular MIME type.
But note that in general the issue will remain: for a type we _don't_ end up rendering inline (so that we show our own error page instead), the network panel won't show the response body.
Product: Firefox → DevTools

(In reply to Victor Porof [:vporof][:vp] from comment #2)

It seems Firefox is actually refusing to show the response in this case. I'm
noticing completely different results in Chrome vs. Firefox.

Chrome: {"status":"500 server error", "foo":"bar"} displayed in the page.
Firefox: File not found. Firefox can't find the file at
http://hallvord.com/temp/moz/bug/json500.php etc.

Indeed, this might be a deeper problem.

Hey!

I just tried this url and see the json - {"status":"500 server error", "foo":"bar"} in the page. In addition to that, I see it the Network tab and in the Response payload.
Firefox: 71.0
OS: Windows 10, Ubuntu/Linux

Thanks for the update!

This also works for me now, closing the report.
Honza

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: