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

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: 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..0ae3d6774a64aa8f3455b023610125d6991b4aea 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,20 @@ SDK.NetworkDispatcher = class {
response.url));
}
+ // The Secure attribute may only be set on cookies if coming from a secure
+ // connection.
+ if (response.url.asParsedURL().scheme !== 'https' &&
+ 'Set-Cookie' in response.headers) {
+ var cookies = SDK.CookieParser.parseSetCookie(this._manager._target, response.headers['Set-Cookie']);
Mike West 2017/01/12 07:59:03 Oh, nice! We already have a parser! :)
+ 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