summaryrefslogtreecommitdiffstats
path: root/chrome_frame/urlmon_url_request.cc
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-26 23:42:42 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-26 23:42:42 +0000
commit8f170168f091f5199ef91ee138b9b030a8a53817 (patch)
treeeff82afe27264a0cfccfee837a16442a77892f92 /chrome_frame/urlmon_url_request.cc
parent87e57e72ad7fefdcb4ee3e952ce27829018c0b66 (diff)
downloadchromium_src-8f170168f091f5199ef91ee138b9b030a8a53817.zip
chromium_src-8f170168f091f5199ef91ee138b9b030a8a53817.tar.gz
chromium_src-8f170168f091f5199ef91ee138b9b030a8a53817.tar.bz2
Add support for chunked encoding in ChromeFrame for POST requests. This fixes the
URLRequestTestHTTP.TestPostChunkedDataBeforeStart net test failure in ChromeFrame. To support chunked encoding we need to marshal the corresponding information in the net::UploadData object to ensure that this object gets reconstructed correctly on the other side (CF). Disabled the URLRequestTestHTTP.TestPostChunkedDataAfterStart for ChromeFrame as this test modifies the UploadData object after it has been marshaled over to CF which we don't support in ChromeFrame. BUG=none TEST=Covered by existing net tests. Review URL: http://codereview.chromium.org/6357017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72723 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/urlmon_url_request.cc')
-rw-r--r--chrome_frame/urlmon_url_request.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/chrome_frame/urlmon_url_request.cc b/chrome_frame/urlmon_url_request.cc
index acbb8a0..1a71f65 100644
--- a/chrome_frame/urlmon_url_request.cc
+++ b/chrome_frame/urlmon_url_request.cc
@@ -22,8 +22,8 @@
#include "chrome_frame/urlmon_upload_data_stream.h"
#include "chrome_frame/utils.h"
#include "net/base/load_flags.h"
-#include "net/http/http_util.h"
#include "net/http/http_response_headers.h"
+#include "net/http/http_util.h"
UrlmonUrlRequest::UrlmonUrlRequest()
: pending_read_size_(0),
@@ -567,11 +567,15 @@ STDMETHODIMP UrlmonUrlRequest::BeginningTransaction(const wchar_t* url,
std::string new_headers;
if (post_data_len() > 0) {
- // Tack on the Content-Length header since when using an IStream type
- // STGMEDIUM, it looks like it doesn't get set for us :(
- new_headers = base::StringPrintf(
- "Content-Length: %s\r\n",
- base::Int64ToString(post_data_len()).c_str());
+ if (is_chunked_upload()) {
+ new_headers = base::StringPrintf("Transfer-Encoding: chunked\r\n");
+ } else {
+ // Tack on the Content-Length header since when using an IStream type
+ // STGMEDIUM, it looks like it doesn't get set for us :(
+ new_headers = base::StringPrintf(
+ "Content-Length: %s\r\n",
+ base::Int64ToString(post_data_len()).c_str());
+ }
}
if (!extra_headers().empty()) {