Carry over modifications to request object in CefHandler::HandleBeforeResourceLoad() (issue #41).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@95 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2010-08-30 20:26:13 +00:00
parent af70b21705
commit a4776a9dda
5 changed files with 63 additions and 6 deletions

View File

@ -161,7 +161,29 @@ void CefRequestImpl::SetHeaderMap(const HeaderMap& map,
}
}
void CefRequestImpl::GetHeaderMap(const std::string& header_str, HeaderMap& map)
std::string CefRequestImpl::GenerateHeaders(const HeaderMap& map)
{
std::string headers;
for(HeaderMap::const_iterator header = map.begin();
header != map.end();
++header) {
const std::wstring& key = header->first;
const std::wstring& value = header->second;
if(!key.empty()) {
// Delimit with "\r\n".
if(!headers.empty())
headers += "\r\n";
headers += WideToUTF8(key) + ": " + WideToUTF8(value);
}
}
return headers;
}
void CefRequestImpl::ParseHeaders(const std::string& header_str, HeaderMap& map)
{
// Parse the request header values
std::string headerStr = "HTTP/1.1 200 OK\n";