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 13 additions and 6 deletions

View File

@@ -11,7 +11,9 @@ Copyright (c) 2011-2012 Jed McCaleb
Some code:
Copyright (c) 2013 Vinnie Falco <vinnie.falco@gmail.com>
Copyright (c) 2013 Bob Way <bob@ripple.com>
Contributions from Vinnie Falco and Bob Way provided under the terms of the ISC License:
Copyright (c) 2013 Eric Lombrozo <elombrozo@gmail.com>
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.

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