diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-22 19:47:23 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-22 19:47:23 +0000 |
commit | c90b8b52a75caf8fb695947aeafd8d76030b47b6 (patch) | |
tree | 62ec345bb9fdb8e7682a34eda84211f49473942a /webkit/glue/multipart_response_delegate.cc | |
parent | 5531c25bf144183612d4bf9f6746a7a682eb7904 (diff) | |
download | chromium_src-c90b8b52a75caf8fb695947aeafd8d76030b47b6.zip chromium_src-c90b8b52a75caf8fb695947aeafd8d76030b47b6.tar.gz chromium_src-c90b8b52a75caf8fb695947aeafd8d76030b47b6.tar.bz2 |
Handle cases where the multipart boundary is improperly prefixed with "--".
The change to webkit_glue::InitializeForTesting is to make it possible to just run the multipart tests using --gtest_filter.
R=tony
BUG=5786
Review URL: http://codereview.chromium.org/16420
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7364 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/multipart_response_delegate.cc')
-rw-r--r-- | webkit/glue/multipart_response_delegate.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/webkit/glue/multipart_response_delegate.cc b/webkit/glue/multipart_response_delegate.cc index 82e73e2..58e8152 100644 --- a/webkit/glue/multipart_response_delegate.cc +++ b/webkit/glue/multipart_response_delegate.cc @@ -33,7 +33,12 @@ MultipartResponseDelegate::MultipartResponseDelegate( first_received_data_(true), processing_headers_(false), stop_sending_(false) { - boundary_.append(boundary); + // Some servers report a boundary prefixed with "--". See bug 5786. + if (StartsWithASCII(boundary, "--", true)) { + boundary_.assign(boundary); + } else { + boundary_.append(boundary); + } } void MultipartResponseDelegate::OnReceivedData(const char* data, int data_len) { |