Merge branch 'develop' of github.com:ripple/rippled into develop

This commit is contained in:
JoelKatz
2013-07-11 15:34:50 -07:00
2 changed files with 10 additions and 5 deletions

BIN
LICENSE

Binary file not shown.

View File

@@ -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) {