Merge pull request #904 from satherton/fix-http-header-case-sensitivity

HTTP header field names are now treated as case insensitive.
This commit is contained in:
Alex Miller 2018-11-12 13:24:03 -08:00 committed by GitHub
commit f1b4377ced
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -24,7 +24,13 @@
#include "fdbclient/Knobs.h"
namespace HTTP {
typedef std::map<std::string, std::string> Headers;
struct is_iless {
bool operator() (const std::string &a, const std::string &b) const {
return strcasecmp(a.c_str(), b.c_str()) < 0;
}
};
typedef std::map<std::string, std::string, is_iless> Headers;
std::string urlEncode(const std::string &s);

View File

@ -469,6 +469,9 @@ inline static void flushOutputStreams() { fflush(NULL); }
#define crashAndDie() (*(volatile int*)0 = 0)
#ifdef _WIN32
#define strcasecmp stricmp
#endif
#if defined(__GNUG__)
#define DEFAULT_CONSTRUCTORS(X) \