Skip to content

Instantly share code, notes, and snippets.

@ptarjan
Created June 10, 2014 17:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ptarjan/d874ce601501ba7ea0ba to your computer and use it in GitHub Desktop.
Save ptarjan/d874ce601501ba7ea0ba to your computer and use it in GitHub Desktop.
diff --git a/hphp/runtime/server/fastcgi/fastcgi-transport.cpp b/hphp/runtime/server/fastcgi/fastcgi-transport.cpp
index 6372f1e..fbe71d6 100644
--- a/hphp/runtime/server/fastcgi/fastcgi-transport.cpp
+++ b/hphp/runtime/server/fastcgi/fastcgi-transport.cpp
@@ -449,7 +449,7 @@ void FastCGITransport::onHeadersComplete() {
m_scriptFilename = getRawHeader(s_pathTranslated);
}
- // do a check for mod_proxy_cgi and remove the start portion of the string
+ // do a check for mod_proxy_fcgi and remove the start portion of the string
const std::string modProxy = "proxy:fcgi://";
if (m_scriptFilename.find(modProxy) == 0) {
m_scriptFilename = m_scriptFilename.substr(modProxy.length());
@@ -458,6 +458,11 @@ void FastCGITransport::onHeadersComplete() {
if (slashPos != String::npos) {
m_scriptFilename = m_scriptFilename.substr(slashPos);
}
+ // remove everything after the first ?
+ int questionPos = m_scriptFilename.find('?');
+ if (questionPos != String::npos) {
+ m_scriptFilename = m_scriptFilename.substr(0, questionPos);
+ }
}
// RequestURI needs script_filename and path_translated to not include
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment