[Http] Only update remoteAddress if local and header

This commit is contained in:
Chris Boden 2013-05-02 19:17:47 -04:00
parent cd0efed085
commit 1ff7998f58

View File

@ -50,7 +50,7 @@ class HttpServer implements MessageComponentInterface {
$from->httpHeadersReceived = true;
if ($request->hasHeader('X-Forwarded-For')) {
if (isset($from->remoteAddress) && '127.0.0.1' == $from->remoteAddress && $request->hasHeader('X-Forwarded-For')) {
$from->remoteAddress = $request->getHeader('X-Forwarded-For', true);
}