Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Own error-page with CGI.pm instead of "Friendly HTTP Error" in Internet-Explorer

by 1nickt (Prior)
on Sep 13, 2017 at 20:07 UTC ( #1199346=note: print w/replies, xml ) Need Help??


in reply to Own error-page with CGI.pm instead of "Friendly HTTP Error" in Internet-Explorer

CGI error pages in Internet Explorer? Holy 1990s!

The HTTP Response body’s byte length must be shorter than a threshold value

Well, that doesn't mention the Content-Length header, does it? Did you try increasing the size of the "HTTP Response body’s byte length"?


The way forward always starts with a minimal test.
  • Comment on Re: Own error-page with CGI.pm instead of "Friendly HTTP Error" in Internet-Explorer

Replies are listed 'Best First'.
Re^2: Own error-page with CGI.pm instead of "Friendly HTTP Error" in Internet-Explorer
by afoken (Abbot) on Sep 13, 2017 at 22:51 UTC

    As far as I remember, the stupid "friendly" error pages from MSIE are activated whenever the server returns an HTTP status code indicating an error AND the content of the error document from the server is less than about 1 kByte. Adding a padding HTML comment of about 1 kByte is sufficient to disable this nonsense. Something like this:

    <!-- padding to prevent "friendly" error pages in ancient MSIEs XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +XXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +XXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +XXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +XXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +XXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +XXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +XXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +XXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +XXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +XXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +XXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +XXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +XXXXXXX -->

    Stackoverflow has a nice info box in an answer, quoting Microsoft:

    What makes IE decide to show a friendly error page?

    The answer is that the server’s response must meet two criteria:

    • The HTTP Status code must be 400, 403, 404, 405, 406, 408, 409, 410, 500, 501, 505
    • The HTTP Response body’s byte length must be shorter than a threshold value

    The byte length thresholds are stored in the registry in HKEY_LOCAL_MACHINE under the subkey \SOFTWARE\Microsoft\Internet Explorer\Main\ErrorThresholds.

    • 403, 405, 410: 256 bytes
    • 400, 404, 406, 408, 409, 500, 501, 505: 512 bytes
    • otherwise: 512 bytes

    So, with a padding to at least 1 kByte message body, you should be on the safe side.

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
Re^2: Own error-page with CGI.pm instead of "Friendly HTTP Error" in Internet-Explorer
by LanX (Bishop) on Sep 13, 2017 at 21:54 UTC
    > CGI error pages

    Legacy code. *

    > Internet Explorer?

    Intranet. Default browser.

    > Holy 1990s!

    Yep!

    > Did you try increasing the size of the "HTTP Response body’s byte length"?

    This did the trick. Thanks!

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Je suis Charlie!

    *) CGI.pm is one of the saner parts of the code base...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1199346]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2017-11-25 06:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (355 votes). Check out past polls.

    Notices?