Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added support for proxies/loadbalancers

  • Loading branch information...
commit 3542b175045ffdeef8f43f7f9b5c8b571f46982e 1 parent 6708871
@stefankleff authored
Showing with 9 additions and 2 deletions.
  1. +9 −2 library/Zend/Log/Processor/RequestId.php
View
11 library/Zend/Log/Processor/RequestId.php
@@ -45,8 +45,15 @@ public function process(array $event)
protected function getIdentifier()
{
$requestTime = (version_compare(PHP_VERSION, '5.4.0') >= 0) ? $_SERVER['REQUEST_TIME_FLOAT'] : $_SERVER['REQUEST_TIME'];
- $remoteAddr = Console::isConsole() ? 'local' : $_SERVER['REMOTE_ADDR'];
- return md5($requestTime . $remoteAddr);
+ if(Console::isConsole()) {
+ return md5($requestTime);
+ }
+
+ if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
+ return md5($requestTime . $_SERVER['HTTP_X_FORWARDED_FOR']);
+ }
+
+ return md5($requestTime . $_SERVER['REMOTE_ADDR']);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.