summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-10 17:19:06 +0000
committertommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-10 17:19:06 +0000
commitfab40420b3f07f423e5822ae97e0924aaf5f9759 (patch)
tree6bc156fa9159fc37edf4176801f37d6d518aef8e
parent8b40baeea37bc2ed6255f7c51405c5d837bdb051 (diff)
downloadchromium_src-fab40420b3f07f423e5822ae97e0924aaf5f9759.zip
chromium_src-fab40420b3f07f423e5822ae97e0924aaf5f9759.tar.gz
chromium_src-fab40420b3f07f423e5822ae97e0924aaf5f9759.tar.bz2
Supressing the referrer header in the automation url request job when going from a secure to non-secure URL.
Also calling OnSSLCertificateError in case of certificate errors. TEST=Run automation tests. BUG=none Review URL: http://codereview.chromium.org/195054 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25867 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/automation/url_request_automation_job.cc19
1 files changed, 15 insertions, 4 deletions
diff --git a/chrome/browser/automation/url_request_automation_job.cc b/chrome/browser/automation/url_request_automation_job.cc
index 349d99e..a585ad6 100644
--- a/chrome/browser/automation/url_request_automation_job.cc
+++ b/chrome/browser/automation/url_request_automation_job.cc
@@ -320,6 +320,16 @@ void URLRequestAutomationJob::OnRequestEnd(
DLOG(INFO) << "URLRequestAutomationJob: " <<
request_->url().spec() << " - request end. Status: " << status.status();
+ // TODO(tommi): When we hit certificate errors, notify the delegate via
+ // OnSSLCertificateError(). Right now we don't have the certificate
+ // so we don't. We could possibly call OnSSLCertificateError with a NULL
+ // certificate, but I'm not sure if all implementations expect it.
+ // if (status.status() == URLRequestStatus::FAILED &&
+ // net::IsCertificateError(status.os_error()) && request_->delegate()) {
+ // request_->delegate()->OnSSLCertificateError(request_, status.os_error(),
+ // NULL);
+ // }
+
DisconnectFromMessageFilter();
NotifyDone(status);
@@ -371,13 +381,14 @@ void URLRequestAutomationJob::StartAsync() {
// Ensure that we do not send username and password fields in the referrer.
GURL referrer(request_->GetSanitizedReferrer());
-#ifndef NDEBUG
- // The referrer header should be suppressed if the preceding URL was
+
+ // The referrer header must be suppressed if the preceding URL was
// a secure one and the new one is not.
if (referrer.SchemeIsSecure() && !request_->url().SchemeIsSecure()) {
- DCHECK(referrer.spec().empty());
+ DLOG(INFO) <<
+ "Suppressing referrer header since going from secure to non-secure";
+ referrer = GURL();
}
-#endif
// Ask automation to start this request.
IPC::AutomationURLRequest automation_request = {