Make HttpError set actual HTTP error code.
authordaniel <daniel.kinzler@wikimedia.de>
Tue, 29 Jan 2013 16:02:19 +0000 (17:02 +0100)
committerdaniel <daniel.kinzler@wikimedia.de>
Tue, 29 Jan 2013 16:02:19 +0000 (17:02 +0100)
Previsouly, HttpError would set a Status header with the desired code,
but would not change the actual HTTP/1.1 header to include that code.

Change-Id: I2f68b1fa410b3619c5be3e82b64f99df97b9415a

includes/Exception.php

index 27ae338..7000119 100644 (file)
@@ -570,7 +570,7 @@ class HttpError extends MWException {
        public function report() {
                $httpMessage = HttpStatus::getMessage( $this->httpCode );
 
-               header( "Status: {$this->httpCode} {$httpMessage}" );
+               header( "Status: {$this->httpCode} {$httpMessage}", true, $this->httpCode );
                header( 'Content-type: text/html; charset=utf-8' );
 
                if ( $this->header === null ) {