Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(823)

Unified Diff: third_party/WebKit/Source/devtools/front_end/sdk/NetworkManager.js

Issue 2623423002: Add console warning and tests for strict secure cookies.
Patch Set: Update comment Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/security/cookies/strict-secure-cookies.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/sdk/NetworkManager.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/NetworkManager.js b/third_party/WebKit/Source/devtools/front_end/sdk/NetworkManager.js
index 248740e8ea6043866c123217c285d6d32f019a08..6b857ebdc418c1fe7527cb3f5d51235143e76199 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/NetworkManager.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/NetworkManager.js
@@ -382,6 +382,22 @@ SDK.NetworkDispatcher = class {
response.url));
}
+ // Cookies with the Secure attribute set will be ignored if coming from an
+ // insecure connection. See net::CanonicalCookie::Create in
+ // net/cookies/canonical_cookie.cc. Note that this console message is meant
+ // to be temporary, and should be removed after 08/01/2017.
+ if (response.url.asParsedURL().scheme !== 'https' &&
+ 'Set-Cookie' in response.headers) {
+ var cookies = SDK.CookieParser.parseSetCookie(this._manager._target, response.headers['Set-Cookie']);
+ for (var i = 0; i < cookies.length; i++) {
+ if (cookies[i].secure()) {
+ Common.console.warn(Common.UIString(
+ 'Set-Cookie for %s is ignored in response from url: %s. It is marked as secure, but the response url is insecure.',
+ cookies[i].name(), response.url));
+ }
+ }
+ }
+
this._updateNetworkRequestWithResponse(networkRequest, response);
this._updateNetworkRequest(networkRequest);
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/security/cookies/strict-secure-cookies.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698