diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-11 19:03:01 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-11 19:03:01 +0000 |
commit | 762d2db5d5e1b0d7852ddb2efef982b00e897322 (patch) | |
tree | 82056cf164237d4e033dbe8ae4dc1fe093923fb6 /chrome_frame | |
parent | 72b3e889a6c7a48957de81156487a1dcd6e0201c (diff) | |
download | chromium_src-762d2db5d5e1b0d7852ddb2efef982b00e897322.zip chromium_src-762d2db5d5e1b0d7852ddb2efef982b00e897322.tar.gz chromium_src-762d2db5d5e1b0d7852ddb2efef982b00e897322.tar.bz2 |
Support the PUT HTTP verb in ChromeFrame in the IE host network stack implementation. This verb is supported
in the Chrome network stack.
Added a urlrequest test for the HTTP PUT verb and corresponding support in the HTTP test server.
Fixes bug http://code.google.com/p/chromium/issues/detail?id=31629
Bug=31629
Test=Covered by net tests.
Review URL: http://codereview.chromium.org/538012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35922 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r-- | chrome_frame/urlmon_url_request.cc | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/chrome_frame/urlmon_url_request.cc b/chrome_frame/urlmon_url_request.cc index de11684..8831447 100644 --- a/chrome_frame/urlmon_url_request.cc +++ b/chrome_frame/urlmon_url_request.cc @@ -470,13 +470,28 @@ STDMETHODIMP UrlmonUrlRequest::GetBindInfo(DWORD* bind_flags, return E_INVALIDARG; *bind_flags = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE | BINDF_PULLDATA; + + bool upload_data = false; + if (LowerCaseEqualsASCII(method(), "get")) { bind_info->dwBindVerb = BINDVERB_GET; } else if (LowerCaseEqualsASCII(method(), "post")) { bind_info->dwBindVerb = BINDVERB_POST; + upload_data = true; + } else if (LowerCaseEqualsASCII(method(), "put")) { + bind_info->dwBindVerb = BINDVERB_PUT; + upload_data = true; + } else { + NOTREACHED() << "Unknown HTTP method."; + status_.set_status(URLRequestStatus::FAILED); + status_.set_os_error(net::ERR_METHOD_NOT_SUPPORTED); + EndRequest(); + return E_FAIL; + } - // Bypass caching proxies on POSTs and avoid writing responses to POST - // requests to the browser's cache. + if (upload_data) { + // Bypass caching proxies on POSTs and PUTs and avoid writing responses to + // these requests to the browser's cache *bind_flags |= BINDF_GETNEWESTVERSION | BINDF_NOWRITECACHE | BINDF_PRAGMA_NO_CACHE; @@ -487,18 +502,13 @@ STDMETHODIMP UrlmonUrlRequest::GetBindInfo(DWORD* bind_flags, if (get_upload_data(&bind_info->stgmedData.pstm) == S_OK) { bind_info->stgmedData.tymed = TYMED_ISTREAM; - DLOG(INFO) << " Obj: " << std::hex << this << " POST request with " - << Int64ToString(post_data_len()) << " bytes"; + DLOG(INFO) << " Obj: " << std::hex << this << " " << method() + << " request with " << Int64ToString(post_data_len()) + << " bytes"; } else { DLOG(INFO) << " Obj: " << std::hex << this << "POST request with no data!"; } - } else { - NOTREACHED() << "Unknown HTTP method."; - status_.set_status(URLRequestStatus::FAILED); - status_.set_os_error(net::ERR_INVALID_URL); - EndRequest(); - return E_FAIL; } return S_OK; |