summaryrefslogtreecommitdiffstats
path: root/chrome/browser/automation/url_request_automation_job.cc
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-24 01:21:35 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-24 01:21:35 +0000
commit86de13da4552bd122f2787872f9c60394661f251 (patch)
tree1d8c0985faff2c3505e6bf11b513047676a590b0 /chrome/browser/automation/url_request_automation_job.cc
parent64144178c9070dd0e08abf0a70c5da87af0f1722 (diff)
downloadchromium_src-86de13da4552bd122f2787872f9c60394661f251.zip
chromium_src-86de13da4552bd122f2787872f9c60394661f251.tar.gz
chromium_src-86de13da4552bd122f2787872f9c60394661f251.tar.bz2
ChromeFrame's host network stack implementation for IE full tab mode implicitly follows redirects.
When Chrome receives a notification about a redirect it also attempts to follow the redirect request. While this works in most cases, some sites actually returned an error for the second request initiated by Chrome. Fix is to abort the request in urlmon, when we receive a notification about a redirect. I also fixed the IsRedirectResponse function in the UrlRequestAutomationJob class to only treat 301, 302, 303 and 307 as redirect codes on the same lines as the default http job. Test=covered by existing network tests. I also verified that http://code.google.com/p/chromium/issues/detail?id=25643 works with this CL. Fixes http://code.google.com/p/chromium/issues/detail?id=28296 Bug=28296 Review URL: http://codereview.chromium.org/402107 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32896 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/automation/url_request_automation_job.cc')
-rw-r--r--chrome/browser/automation/url_request_automation_job.cc20
1 files changed, 6 insertions, 14 deletions
diff --git a/chrome/browser/automation/url_request_automation_job.cc b/chrome/browser/automation/url_request_automation_job.cc
index f6d4ecd..97522d2 100644
--- a/chrome/browser/automation/url_request_automation_job.cc
+++ b/chrome/browser/automation/url_request_automation_job.cc
@@ -198,20 +198,12 @@ int URLRequestAutomationJob::GetResponseCode() const {
bool URLRequestAutomationJob::IsRedirectResponse(
GURL* location, int* http_status_code) {
- static const int kDefaultHttpRedirectResponseCode = 301;
-
- if (!redirect_url_.empty()) {
- DLOG_IF(ERROR, redirect_status_ == 0) << "Missing redirect status?";
- *http_status_code = redirect_status_ ? redirect_status_ :
- kDefaultHttpRedirectResponseCode;
- *location = GURL(redirect_url_);
- return true;
- } else {
- DCHECK(redirect_status_ == 0)
- << "Unexpectedly have redirect status but no URL";
- }
+ if (!net::HttpResponseHeaders::IsRedirectResponseCode(redirect_status_))
+ return false;
- return false;
+ *http_status_code = redirect_status_;
+ *location = GURL(redirect_url_);
+ return true;
}
bool URLRequestAutomationJob::MayFilterMessage(const IPC::Message& message,
@@ -255,7 +247,7 @@ void URLRequestAutomationJob::OnRequestStarted(int tab, int id,
GURL url_for_cookies =
GURL(redirect_url_.empty() ? request_->url().spec().c_str() :
- redirect_url_.c_str());
+ redirect_url_.c_str());
URLRequestContext* ctx = request_->context();