r84729 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84728‎ | r84729 | r84730 >
Date:03:36, 25 March 2011
Author:mah
Status:ok (Comments)
Tags:
Comment:
Fixes Bug #28214 - When page not found, sends malformed HTTP/1.x instead of HTTP/1.1 in header of respons

Note that there are a few places in the source where headers are sent
with HTTP/1.0 instead of HTTP/1.1 but this patch doesa not address those
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)
  • /trunk/phase3/includes/ImagePage.php (modified) (history)
  • /trunk/phase3/includes/WebStart.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -1404,7 +1404,7 @@
14051405 if ( !$this->hasViewableContent() ) {
14061406 // If there's no backing content, send a 404 Not Found
14071407 // for better machine handling of broken links.
1408 - $wgRequest->response()->header( "HTTP/1.x 404 Not Found" );
 1408+ $wgRequest->response()->header( "HTTP/1.1 404 Not Found" );
14091409 }
14101410
14111411 $wgOut->addWikiText( $text );
Index: trunk/phase3/includes/ImagePage.php
@@ -520,7 +520,7 @@
521521 if ( !$this->getID() ) {
522522 // If there is no image, no shared image, and no description page,
523523 // output a 404, to be consistent with articles.
524 - $wgRequest->response()->header( "HTTP/1.x 404 Not Found" );
 524+ $wgRequest->response()->header( "HTTP/1.1 404 Not Found" );
525525 }
526526 }
527527 }
Index: trunk/phase3/includes/WebStart.php
@@ -34,7 +34,7 @@
3535 );
3636 foreach ( $_REQUEST as $name => $value ) {
3737 if( in_array( $name, $verboten ) ) {
38 - header( "HTTP/1.x 500 Internal Server Error" );
 38+ header( "HTTP/1.1 500 Internal Server Error" );
3939 echo "register_globals security paranoia: trying to overwrite superglobals, aborting.";
4040 die( -1 );
4141 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r852561.17wmf1: MFT r80813, r80815, r83798, r84459, r84729, r84820, r84921, r84985,...catrope14:13, 3 April 2011
r85435MFT: r84431, r84464, r84543, r84553, r84573, r84574, r84577, r84729, r84765, ...demon14:00, 5 April 2011

Comments

#Comment by Platonides (talk | contribs)   16:37, 25 March 2011

Seems right "An HTTP server SHOULD send a response version equal to the highest version for which the server is at least conditionally compliant, and whose major version is less than or equal to the one received in the request. An HTTP server MUST NOT send a version for which it is not at least conditionally compliant." (RFC 2145) We can't be certaing about if the server on which mediawiki will be running is really supporting HTTP/1.1, but the headers of this connection will be managed by php. If the client is fooled to think that a HTTP/1.0 server supports HTTP/1.1, and send HTTP/1.1 features, that's the normal behavior anyway (An HTTP client SHOULD send a request version equal to the highest version for which the client is at least conditionally compliant).

Status & tagging log