Permalink
Browse files

Take the last value for a fastcgi param if multiple values are provided

Summary: If a fastcgi param was provided multiple times in the one request, the first value would be used.  This will now take the last one, which is what PHP does.
Closes #2924

Reviewed By: @ptarjan

Differential Revision: D1381723

Pulled By: @JoelMarcey
  • Loading branch information...
leev authored and facebook-github-bot committed Jun 13, 2014
1 parent 71a7e47 commit 80638d7e97db40753f7b374010dd78716c717e87
Showing with 4 additions and 1 deletion.
  1. +4 −1 hphp/runtime/server/fastcgi/fastcgi-transport.cpp
@@ -366,7 +366,10 @@ void FastCGITransport::onHeader(std::unique_ptr<folly::IOBuf> key_chain,
cursor = Cursor(value_chain.get());
std::string value = cursor.readFixedString(
value_chain->computeChainDataLength());
m_requestHeaders.emplace(key, value);
auto it = m_requestHeaders.emplace(key, value);
if (!it.second) {
it.first->second = value;
}
}
static const std::string

0 comments on commit 80638d7

Please sign in to comment.