Use case-insensitive comparison for header names in *_header_access and *_header_replace directives. === modified file 'src/HttpHeaderTools.h' --- src/HttpHeaderTools.h 2013-02-17 09:31:18 +0000 +++ src/HttpHeaderTools.h 2013-05-15 16:31:39 +0000 @@ -5,6 +5,9 @@ #include "HttpHeader.h" #include "typedefs.h" +#if HAVE_FUNCTIONAL +#include +#endif #if HAVE_LIST #include #endif @@ -14,6 +17,9 @@ #if HAVE_STRING #include #endif +#if HAVE_STRINGS_H +#include +#endif class acl_access; class ACLList; @@ -56,8 +62,17 @@ void dumpReplacement(StoreEntry *entry, const char *optionName) const; private: + /// Case-insensitive std::string comparison functor. + /// Fast version recommended by Meyers' "Effective STL" for ASCII c-strings. + class NoCaseLess: public std::binary_function { + public: + bool operator()(const std::string &lhs, const std::string &rhs) const { + return strcasecmp(lhs.c_str(), rhs.c_str()) < 0; + } + }; + /// a name:mangler map; optimize: use unordered map or some such - typedef std::map ManglersByName; + typedef std::map ManglersByName; /// one mangler for each known header headerMangler known[HDR_ENUM_END];