Fixes encoding issues when using a custom resource handler (issue #1906).

This commit is contained in:
Mike Wiedenbauer 2018-02-22 19:05:54 +00:00 committed by Marshall Greenblatt
parent 0ac37cefa1
commit 39ccd85d77
2 changed files with 9 additions and 0 deletions

View File

@ -328,6 +328,14 @@ bool CefResourceRequestJob::GetMimeType(std::string* mime_type) const {
return true;
}
bool CefResourceRequestJob::GetCharset(std::string* charset) {
CEF_REQUIRE_IOT();
if (net::HttpResponseHeaders *headers = GetResponseHeaders())
return headers->GetCharset(charset);
return false;
}
void CefResourceRequestJob::SendHeaders() {
CEF_REQUIRE_IOT();

View File

@ -40,6 +40,7 @@ class CefResourceRequestJob : public net::URLRequestJob {
void GetLoadTimingInfo(net::LoadTimingInfo* load_timing_info) const override;
bool IsRedirectResponse(GURL* location, int* http_status_code) override;
bool GetMimeType(std::string* mime_type) const override;
bool GetCharset(std::string* charset) override;
void SendHeaders();