Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make Chrome display pages even on 500 or 404 codes (behave like Firefox)

We're developing a new site in Symfony. When Symfony encounters an error, such as a "no route found", and debug is set to true, it not only outputs a 404 code, it actually shows the error on the page. Firefox displays what the server returned, but Chrome does not.

For my no route found example:

Firefox shows this: http://i.imgur.com/myF85Sl.png
Chrome shows this: http://i.imgur.com/hex19In.png

Is there a way to get Chrome to behave like Firefox under these conditions?

Edit: There seems to be some questioning of what's actually happening. I don't know what's causing this, otherwise I would fix it. Here's what I see in the Chrome network inspector (note that this image is for a 500 error, but the same happens with 404's): http://i.imgur.com/VIOWGRy.png

Notice the content length of zero. If I go to the exact same URL through Firefox (same server, everything), it shows the actual Symfony error.

like image 478
nwalke Avatar asked Jul 17 '13 16:07

nwalke


2 Answers

There is a bug report raised for this:

Issue 1695: Chrome needs option to turn off "Friendly 404" displays

According to the comments on that issue, if the server error page is more than 512 bytes, then it gets displayed correctly.

That said, I can't actually reproduce the problem, so I'm not sure if that workaround actually fixes it.

like image 175
James Holderness Avatar answered Oct 21 '22 22:10

James Holderness


Under the monolog config in your config_dev.yml, remove the firephp/chromephp sections.

like image 44
Trololololol Avatar answered Oct 21 '22 21:10

Trololololol