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-03-08 22:28:54 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-08 22:28:54 +0000
commit21fe262203cfd4e99cd4ebc9bdd1d8f224145517 (patch)
tree84d2efceee5bd49566590abc4b97fd363cb36693 /chrome_frame/urlmon_url_request.cc
parent1b66eab3d49733d5a256fa119469ccb8adec7c01 (diff)
downloadchromium_src-21fe262203cfd4e99cd4ebc9bdd1d8f224145517.zip
chromium_src-21fe262203cfd4e99cd4ebc9bdd1d8f224145517.tar.gz
chromium_src-21fe262203cfd4e99cd4ebc9bdd1d8f224145517.tar.bz2
Fix for the chrome frame bug with POST requests to servers which request NTLM authentication.
The bug was that the POST request would be issued to the server with no data. Reason: The cbstgmedData member in the BINDINFO structure passed into our IBindStatusCallback::GetBindInfo implementation needs to be initialized to the post data length. Not setting this causes urlmon to treat this as a chunked upload thus causing it to not set the Content-Length header in the outgoing POST request. Many thanks to Igor Tandetnik for pointing this out. Removed the code to set the Content-Length header in our BeginningTransaction implementation as this is no longer needed. Fixes bug http://code.google.com/p/chromium/issues/detail?id=62687 BUG=62687 TEST=manually at this point with an IIS web server configured for NTLM authentication. Review URL: http://codereview.chromium.org/6651003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77348 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/urlmon_url_request.cc')
-rw-r--r--chrome_frame/urlmon_url_request.cc9
1 files changed, 3 insertions, 6 deletions
diff --git a/chrome_frame/urlmon_url_request.cc b/chrome_frame/urlmon_url_request.cc
index 81a3d88..b7d3fdb 100644
--- a/chrome_frame/urlmon_url_request.cc
+++ b/chrome_frame/urlmon_url_request.cc
@@ -484,6 +484,9 @@ STDMETHODIMP UrlmonUrlRequest::GetBindInfo(DWORD* bind_flags,
if (get_upload_data(&bind_info->stgmedData.pstm) == S_OK) {
bind_info->stgmedData.tymed = TYMED_ISTREAM;
+#pragma warning(disable:4244)
+ bind_info->cbstgmedData = post_data_len();
+#pragma warning(default:4244)
DVLOG(1) << __FUNCTION__ << me() << method()
<< " request with " << base::Int64ToString(post_data_len())
<< " bytes. url=" << url();
@@ -582,12 +585,6 @@ STDMETHODIMP UrlmonUrlRequest::BeginningTransaction(const wchar_t* url,
if (post_data_len() > 0) {
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());
}
}