CGI: pad error responses with 512 bytes of spaces so IE will display them

IE displays its own error responses unless the server's was >= 512 bytes.
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q294807
master
Simon McVittie 2009-01-31 18:26:37 +00:00
parent 170b86a2ef
commit dedbe110f2
1 changed files with 7 additions and 1 deletions

View File

@ -239,6 +239,9 @@ sub check_banned ($$) {
print $q->header(-status => "403 Forbidden"); print $q->header(-status => "403 Forbidden");
$session->delete(); $session->delete();
print gettext("You are banned."); print gettext("You are banned.");
# Internet Explorer won't show custom 404 responses
# unless they're >= 512 bytes
print " " x 512;
cgi_savesession($session); cgi_savesession($session);
exit; exit;
} }
@ -323,7 +326,10 @@ sub cgi_goto ($;$) {
"<p>". "<p>".
sprintf(gettext("The page %s does not exist."), sprintf(gettext("The page %s does not exist."),
htmllink("", "", $page)). htmllink("", "", $page)).
"</p>"); "</p>".
# Internet Explorer won't show custom 404 responses
# unless they're >= 512 bytes
(" " x 512));
} }
else { else {
redirect($q, urlto($link, undef, 1)); redirect($q, urlto($link, undef, 1));