From 21fe262203cfd4e99cd4ebc9bdd1d8f224145517 Mon Sep 17 00:00:00 2001 From: "ananta@chromium.org" Date: Tue, 8 Mar 2011 22:28:54 +0000 Subject: 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 --- chrome_frame/urlmon_url_request.cc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'chrome_frame/urlmon_url_request.cc') 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()); } } -- cgit v1.1