diff options
author | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-13 00:54:47 +0000 |
---|---|---|
committer | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-13 00:54:47 +0000 |
commit | 6eca5f19ffabd672349df42595551e7a4b1da987 (patch) | |
tree | c9f2565f1ef32435072aba1dace92de204b58f1d /webkit/glue/multipart_response_delegate.cc | |
parent | 4c9ef951d9d3c32d7955583bba6639efac26362c (diff) | |
download | chromium_src-6eca5f19ffabd672349df42595551e7a4b1da987.zip chromium_src-6eca5f19ffabd672349df42595551e7a4b1da987.tar.gz chromium_src-6eca5f19ffabd672349df42595551e7a4b1da987.tar.bz2 |
Fix a bug where we were setting the mime-type to the full
content-type (e.g., text/html; charset=utf-8) in multipart
responses.
This fixes a bug where e.g., CUPS pages wouldn't be rendered
properly.
BUG=25217
TEST=Covered by unittests.
Review URL: http://codereview.chromium.org/385046
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31867 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/multipart_response_delegate.cc')
-rw-r--r-- | webkit/glue/multipart_response_delegate.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/webkit/glue/multipart_response_delegate.cc b/webkit/glue/multipart_response_delegate.cc index a5420b6..2306760 100644 --- a/webkit/glue/multipart_response_delegate.cc +++ b/webkit/glue/multipart_response_delegate.cc @@ -7,6 +7,7 @@ #include "base/logging.h" #include "base/string_util.h" #include "net/base/net_util.h" +#include "net/http/http_util.h" #include "third_party/WebKit/WebKit/chromium/public/WebHTTPHeaderVisitor.h" #include "third_party/WebKit/WebKit/chromium/public/WebString.h" #include "third_party/WebKit/WebKit/chromium/public/WebURL.h" @@ -206,8 +207,12 @@ bool MultipartResponseDelegate::ParseHeaders() { // Create a WebURLResponse based on the original set of headers + the // replacement headers. We only replace the same few headers that gecko // does. See netwerk/streamconv/converters/nsMultiMixedConv.cpp. - std::string mime_type = net::GetSpecificHeader(headers, "content-type"); - std::string charset = net::GetHeaderParamValue(mime_type, "charset"); + std::string content_type = net::GetSpecificHeader(headers, "content-type"); + std::string mime_type; + std::string charset; + bool has_charset = false; + net::HttpUtil::ParseContentType(content_type, &mime_type, &charset, + &has_charset); WebURLResponse response(original_response_.url()); response.setMIMEType(StdStringToWebString(mime_type)); response.setTextEncodingName(StdStringToWebString(charset)); |