Commit fab40420 authored by tommi@chromium.org's avatar tommi@chromium.org

Supressing the referrer header in the automation url request job when going...

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
parent 8b40baee
......@@ -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 = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment