Created
January 14, 2014 02:04
-
-
Save ptarjan/8411810 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/hphp/runtime/server/fastcgi/fastcgi-transport.cpp b/hphp/runtime/server/fastcgi/fastcgi-transport.cpp | |
index ae0dddf..28e719a 100644 | |
--- a/hphp/runtime/server/fastcgi/fastcgi-transport.cpp | |
+++ b/hphp/runtime/server/fastcgi/fastcgi-transport.cpp | |
@@ -303,6 +303,7 @@ void FastCGITransport::onBodyComplete() { | |
const std::string FastCGITransport::k_requestURIKey = "REQUEST_URI"; | |
const std::string FastCGITransport::k_remoteHostKey = "REMOTE_HOST"; | |
+const std::string FastCGITransport::k_remoteAddrKey = "REMOTE_ADDR"; | |
const std::string FastCGITransport::k_remotePortKey = "REMOTE_PORT"; | |
const std::string FastCGITransport::k_methodKey = "REQUEST_METHOD"; | |
const std::string FastCGITransport::k_httpVersionKey = "HTTP_VERSION"; | |
@@ -340,6 +341,9 @@ void FastCGITransport::handleHeader(const std::string& key, | |
m_requestURI = value; | |
} else if (compareKeys(key, k_remoteHostKey)) { | |
m_remoteHost = value; | |
+ } else if (compareKeys(key, k_remoteAddrKey)) { | |
+ // This is an alternate name for the same headers as k_remoteHostKey | |
+ m_remoteHost = value; | |
} else if (compareKeys(key, k_remotePortKey)) { | |
try { | |
int remote_port = std::stoi(value); | |
diff --git a/hphp/runtime/server/fastcgi/fastcgi-transport.h b/hphp/runtime/server/fastcgi/fastcgi-transport.h | |
index 016a283..0d5da21 100644 | |
--- a/hphp/runtime/server/fastcgi/fastcgi-transport.h | |
+++ b/hphp/runtime/server/fastcgi/fastcgi-transport.h | |
@@ -110,6 +110,7 @@ private: | |
static const std::string k_requestURIKey; | |
static const std::string k_remoteHostKey; | |
+ static const std::string k_remoteAddrKey; | |
static const std::string k_remotePortKey; | |
static const std::string k_methodKey; | |
static const std::string k_httpVersionKey; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment