diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-07 21:57:30 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-07 21:57:30 +0000 |
commit | 57279b98cf12689c603425fecec9d6e3e85515f5 (patch) | |
tree | 540a1bf717086c7ae7edc5d583a05e6ee8598906 /webkit/glue/multipart_response_delegate.cc | |
parent | f07f39e6a966ae3397bc032e5c8fc543c0db7789 (diff) | |
download | chromium_src-57279b98cf12689c603425fecec9d6e3e85515f5.zip chromium_src-57279b98cf12689c603425fecec9d6e3e85515f5.tar.gz chromium_src-57279b98cf12689c603425fecec9d6e3e85515f5.tar.bz2 |
Certain PDF files would not load in Chrome if the HTTP multipart response contains the Range header
instead of the Content-Range header. This would cause the Acrobat PDF plugin to freeze or display an
error message.
Fix is to look for the Range header while parsing the multipart response if we fail to find the Content-Range
header.
This fixes bug http://code.google.com/p/chromium/issues/detail?id=31050
Bug=31050
Test=Covered by test_shell_tests.
Review URL: http://codereview.chromium.org/521048
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35740 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/multipart_response_delegate.cc')
-rw-r--r-- | webkit/glue/multipart_response_delegate.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/webkit/glue/multipart_response_delegate.cc b/webkit/glue/multipart_response_delegate.cc index a9c60ca..20e207a 100644 --- a/webkit/glue/multipart_response_delegate.cc +++ b/webkit/glue/multipart_response_delegate.cc @@ -285,8 +285,15 @@ bool MultipartResponseDelegate::ReadContentRanges( int* content_range_lower_bound, int* content_range_upper_bound) { - std::string content_range = - response.httpHeaderField(WebString::fromUTF8("Content-Range")).utf8(); + std::string content_range = response.httpHeaderField("Content-Range").utf8(); + if (content_range.empty()) { + content_range = response.httpHeaderField("Range").utf8(); + } + + if (content_range.empty()) { + DLOG(WARNING) << "Failed to read content range from response."; + return false; + } size_t byte_range_lower_bound_start_offset = content_range.find(" "); if (byte_range_lower_bound_start_offset == std::string::npos) { |