diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-30 21:48:57 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-30 21:48:57 +0000 |
commit | be6fca6c1f6e90be5a1d513130433a2434fadf64 (patch) | |
tree | 4ab379225dd316aeab53291518473d048988cf08 /net/url_request/url_request_http_job.cc | |
parent | d406e2e329cc7240e29597b35a7c20433c560a51 (diff) | |
download | chromium_src-be6fca6c1f6e90be5a1d513130433a2434fadf64.zip chromium_src-be6fca6c1f6e90be5a1d513130433a2434fadf64.tar.gz chromium_src-be6fca6c1f6e90be5a1d513130433a2434fadf64.tar.bz2 |
If the URLRequestContext has no CookiePolicy, then we should
allow cookies instead of denying them.
I broke this yesterday when I made the CookiePolicy be an optional
element of the URLRequestContext. See r37624.
R=pkasting
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/557073
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37649 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/url_request/url_request_http_job.cc')
-rw-r--r-- | net/url_request/url_request_http_job.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc index 7ec4ccf..4b08c64 100644 --- a/net/url_request/url_request_http_job.cc +++ b/net/url_request/url_request_http_job.cc @@ -512,9 +512,9 @@ void URLRequestHttpJob::NotifyHeadersComplete() { // Get the Set-Cookie values, and send them to our cookie database. if (!(request_info_.load_flags & net::LOAD_DO_NOT_SAVE_COOKIES)) { URLRequestContext* ctx = request_->context(); - if (ctx && ctx->cookie_store() && ctx->cookie_policy() && + if (ctx && ctx->cookie_store() && (!ctx->cookie_policy() || ctx->cookie_policy()->CanSetCookie( - request_->url(), request_->first_party_for_cookies())) { + request_->url(), request_->first_party_for_cookies()))) { FetchResponseCookies(); net::CookieOptions options; options.set_include_httponly(); @@ -668,9 +668,9 @@ std::string URLRequestHttpJob::AssembleRequestCookies() { URLRequestContext* context = request_->context(); if (context) { // Add in the cookie header. TODO might we need more than one header? - if (context->cookie_store() && context->cookie_policy() && + if (context->cookie_store() && (!context->cookie_policy() || context->cookie_policy()->CanGetCookies( - request_->url(), request_->first_party_for_cookies())) { + request_->url(), request_->first_party_for_cookies()))) { net::CookieOptions options; options.set_include_httponly(); std::string cookies = request_->context()->cookie_store()-> |