r99287 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99286‎ | r99287 | r99288 >
Date:00:17, 8 October 2011
Author:tstarling
Status:ok
Tags:
Comment:
Send an X-Forwarded-For header to the collection server, so that the source of PDF rendering traffic can easily be determined using tcpdump
Modified paths:
  • /branches/wmf/1.18wmf1/extensions/Collection/Collection.body.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.18wmf1/extensions/Collection/Collection.body.php
@@ -1268,7 +1268,14 @@
12691269 curl_setopt( $c, CURLOPT_POST, true );
12701270 curl_setopt( $c, CURLOPT_POSTFIELDS, $postFields );
12711271 }
1272 - curl_setopt( $c, CURLOPT_HTTPHEADER, array( 'Expect:' ) );
 1272+
 1273+ # Send the client IP to the server
 1274+ $headers = array(
 1275+ 'Expect:',
 1276+ 'X-Forwarded-For: ' . wfGetIP()
 1277+ );
 1278+ curl_setopt( $c, CURLOPT_HTTPHEADER, $headers );
 1279+
12731280 curl_setopt( $c, CURLOPT_HEADER, false );
12741281 if ( is_object( $wgTitle ) ) {
12751282 curl_setopt( $c, CURLOPT_REFERER, wfExpandUrl( $wgTitle->getFullURL(), PROTO_CURRENT ) );

Status & tagging log