Modify CefResponse header methods to match CefRequest API (fixes issue #2770)

This commit is contained in:
Mike Wiedenbauer
2019-10-14 13:32:38 +02:00
committed by Marshall Greenblatt
parent 9cdda243a1
commit 1d515adc22
16 changed files with 231 additions and 50 deletions

View File

@@ -4,6 +4,9 @@
#include "libcef/common/net/http_header_utils.h"
#include <algorithm>
#include "base/strings/string_util.h"
#include "net/http/http_response_headers.h"
#include "net/http/http_util.h"
@@ -40,4 +43,18 @@ void ParseHeaders(const std::string& header_str, HeaderMap& map) {
}
}
void MakeASCIILower(std::string* str) {
std::transform(str->begin(), str->end(), str->begin(), ::tolower);
}
HeaderMap::iterator FindHeaderInMap(const std::string& nameLower,
HeaderMap& map) {
for (auto it = map.begin(); it != map.end(); ++it) {
if (base::EqualsCaseInsensitiveASCII(it->first.ToString(), nameLower))
return it;
}
return map.end();
}
} // namespace HttpHeaderUtils