Permalink
Browse files

Add X-Forwarded-For header to assert IP address of anonymous users.

  • Loading branch information...
1 parent 5ecddd0 commit 4e72283e666cd4fdaf1ed5366c443a813c1eb06f @jimsafley jimsafley committed Feb 23, 2012
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/Scripto/Service/MediaWiki.php
@@ -112,6 +112,7 @@ public function __construct($apiUrl, $passCookies = true)
// Set the HTTP client for the MediaWiki API .
self::getHttpClient()->setUri($apiUrl)
->setConfig(array('keepalive' => true))
+ ->setHeaders('X-Forwarded-For', $_SERVER['REMOTE_ADDR'] . ', ' . $_SERVER['SERVER_ADDR'])
->setCookieJar();
// Set the cookie prefix that was set by MediaWiki during login.

0 comments on commit 4e72283

Please sign in to comment.