BUGFIX: Better error message when 401 response is corrupted.

This commit is contained in:
Sam Minnee 2011-03-11 15:09:52 +13:00 committed by Ingo Schommer
parent f8206d15c8
commit 82988d421b

View File

@ -220,11 +220,17 @@ class SS_HTTPResponse {
<meta http-equiv=\"refresh\" content=\"1; url=$url\" /> <meta http-equiv=\"refresh\" content=\"1; url=$url\" />
<script type=\"text/javascript\">setTimeout('window.location.href = \"$url\"', 50);</script>"; <script type=\"text/javascript\">setTimeout('window.location.href = \"$url\"', 50);</script>";
} else { } else {
if(!headers_sent()) { $line = $file = null;
if(!headers_sent($file, $line)) {
header($_SERVER['SERVER_PROTOCOL'] . " $this->statusCode " . $this->getStatusDescription()); header($_SERVER['SERVER_PROTOCOL'] . " $this->statusCode " . $this->getStatusDescription());
foreach($this->headers as $header => $value) { foreach($this->headers as $header => $value) {
header("$header: $value", true, $this->statusCode); header("$header: $value", true, $this->statusCode);
} }
} else {
// It's critical that these status codes are sent; we need to report a failure if not.
if($this->statusCode >= 300) {
user_error("Couldn't set response type to $this->statusCode because of output on line $line of $file", E_USER_WARNING);
}
} }
// Only show error pages or generic "friendly" errors if the status code signifies // Only show error pages or generic "friendly" errors if the status code signifies