What rules does IE use to determine whether to show the body of an object?

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.)

+4
source share
1 answer

This is apparently upset by design. Terms:

  • The error is one of [400, 403, 404, 405, 406, 408, 409, 410, 500, 501, 505]
  • The entity body size in bytes is less than the threshold specified by HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Main\ErrorThresholds

Also note the default values:

The default threshold is 256 bytes for response codes [403, 405, 410] and 512 bytes for response codes [400, 404, 406, 408, 409, 500, 501, 505]. If a registry entry is missing for one of the status codes, its threshold is 512 bytes by default.

http://blogs.msdn.com/b/ieinternals/archive/2010/08/19/http-error-pages-in-internet-explorer.aspx

+3
source

Source: https://habr.com/ru/post/1482619/


All Articles