r107121 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107120‎ | r107121 | r107122 >
Date:23:12, 22 December 2011
Author:brion
Status:ok
Tags:
Comment:
Add comments explaining that the funky multiple Location headers stuff is a CURL artifact, and that the code will need updating if bug 29232 is done (high-level handling of http redirects)

Followup r94881, r106948.
Modified paths:
  • /trunk/phase3/includes/HttpFunctions.php (modified) (history)
  • /trunk/phase3/tests/phpunit/includes/HttpTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/includes/HttpTest.php
@@ -124,6 +124,14 @@
125125 );
126126 }
127127
 128+ /**
 129+ * Warning:
 130+ *
 131+ * These tests are for code that makes use of an artifact of how CURL
 132+ * handles header reporting on redirect pages, and will need to be
 133+ * rewritten when bug 29232 is taken care of (high-level handling of
 134+ * HTTP redirects).
 135+ */
128136 function testRelativeRedirections() {
129137 $h = new MWHttpRequestTester( 'http://oldsite/file.ext' );
130138 # Forge a Location header
Index: trunk/phase3/includes/HttpFunctions.php
@@ -591,6 +591,10 @@
592592 * Relative values of the "Location" header are incorrect as stated in RFC, however they do happen and modern browsers support them.
593593 * This function loops backwards through all locations in order to build the proper absolute URI - Marooned at wikia-inc.com
594594 *
 595+ * Note that the multiple Location: headers are an artifact of CURL -- they
 596+ * shouldn't actually get returned this way. Rewrite this when bug 29232 is
 597+ * taken care of (high-level redirect handling rewrite).
 598+ *
595599 * @return string
596600 */
597601 public function getFinalUrl() {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r94881Relative values of the "Location" header are incorrect as stated in RFC, howe...marooned10:33, 18 August 2011
r106948tests for r94881 which interprets relative Location: headershashar15:31, 21 December 2011

Status & tagging log