diff --git a/LICENSE b/LICENSE index e0429f8b28..98798675e5 100644 --- a/LICENSE +++ b/LICENSE @@ -11,7 +11,9 @@ Copyright (c) 2011-2012 Jed McCaleb Some code: Copyright (c) 2013 Vinnie Falco Copyright (c) 2013 Bob Way - Contributions from Vinnie Falco and Bob Way provided under the terms of the ISC License: +Copyright (c) 2013 Eric Lombrozo + Contributions from Vinnie Falco, Bob Way, and Eric Lombrozo + provided under the terms of the ISC License: Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. diff --git a/Subtrees/websocket/src/http/parser.hpp b/Subtrees/websocket/src/http/parser.hpp index 2a4918b60a..72fb0a65de 100644 --- a/Subtrees/websocket/src/http/parser.hpp +++ b/Subtrees/websocket/src/http/parser.hpp @@ -83,7 +83,12 @@ public: } std::string header(const std::string& key) const { - header_list::const_iterator h = m_headers.find(tolower(key)); + header_list::const_iterator h = m_headers.find(key); + if (h != m_headers.end()) { + return h->second; + } + + h = m_headers.find(tolower(key)); if (h == m_headers.end()) { return ""; @@ -97,18 +102,18 @@ public: void add_header(const std::string &key, const std::string &val) { // TODO: prevent use of reserved headers? if (this->header(key) == "") { - m_headers[tolower(key)] = val; + m_headers[key] = val; } else { - m_headers[tolower(key)] += ", " + val; + m_headers[key] += ", " + val; } } void replace_header(const std::string &key, const std::string &val) { - m_headers[tolower(key)] = val; + m_headers[key] = val; } void remove_header(const std::string &key) { - m_headers.erase(tolower(key)); + m_headers.erase(key); } protected: bool parse_headers(std::istream& s) {