At least on IE 9, sometimes, the browser decides simply not to show the body of the entity that it served by the web browser, and instead displays its own page. It seems like this is being done for some errors, such as 403, 404, 500, etc.
Sometimes, however, it displays the body of the object sent by the server.
What conditions does he use to determine whether to show an answer?
What I did: I built a small web server that, through a query string, takes an argument about which code will be returned and returns (with the status code ):
<!DOCTYPE html> <html> <head></head> <body> <h1>Response {code}</h1> Hi. I'm an <em>HTML document</em>. I should be the response of a code {code}. </body></html>
I call this via /my-page?code=400 , /my-page?code=500 , etc. Sometimes I get a page, sometimes I do not. Chrome checks to see if a status code is being sent. (And displays the page.)
source share