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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 networkRequest.responseReceivedTime = time; 375 networkRequest.responseReceivedTime = time;
376 networkRequest.setResourceType(Common.resourceTypes[resourceType]); 376 networkRequest.setResourceType(Common.resourceTypes[resourceType]);
377 377
378 // net::ParsedCookie::kMaxCookieSize = 4096 (net/cookies/parsed_cookie.h) 378 // net::ParsedCookie::kMaxCookieSize = 4096 (net/cookies/parsed_cookie.h)
379 if ('Set-Cookie' in response.headers && response.headers['Set-Cookie'].lengt h > 4096) { 379 if ('Set-Cookie' in response.headers && response.headers['Set-Cookie'].lengt h > 4096) {
380 Common.console.warn(Common.UIString( 380 Common.console.warn(Common.UIString(
381 'Set-Cookie header is ignored in response from url: %s. Cookie length should be less then or equal to 4096 characters.', 381 'Set-Cookie header is ignored in response from url: %s. Cookie length should be less then or equal to 4096 characters.',
382 response.url)); 382 response.url));
383 } 383 }
384 384
385 // Cookies with the Secure attribute set will be ignored if coming from an
386 // insecure connection. See net::CanonicalCookie::Create in
387 // net/cookies/canonical_cookie.cc. Note that this console message is meant
388 // to be temporary, and should be removed after 08/01/2017.
389 if (response.url.asParsedURL().scheme !== 'https' &&
390 'Set-Cookie' in response.headers) {
391 var cookies = SDK.CookieParser.parseSetCookie(this._manager._target, respo nse.headers['Set-Cookie']);
392 for (var i = 0; i < cookies.length; i++) {
393 if (cookies[i].secure()) {
394 Common.console.warn(Common.UIString(
395 'Set-Cookie for %s is ignored in response from url: %s. It is mark ed as secure, but the response url is insecure.',
396 cookies[i].name(), response.url));
397 }
398 }
399 }
400
385 this._updateNetworkRequestWithResponse(networkRequest, response); 401 this._updateNetworkRequestWithResponse(networkRequest, response);
386 402
387 this._updateNetworkRequest(networkRequest); 403 this._updateNetworkRequest(networkRequest);
388 this._manager.dispatchEventToListeners(SDK.NetworkManager.Events.ResponseRec eived, networkRequest); 404 this._manager.dispatchEventToListeners(SDK.NetworkManager.Events.ResponseRec eived, networkRequest);
389 } 405 }
390 406
391 /** 407 /**
392 * @override 408 * @override
393 * @param {!Protocol.Network.RequestId} requestId 409 * @param {!Protocol.Network.RequestId} requestId
394 * @param {!Protocol.Network.Timestamp} time 410 * @param {!Protocol.Network.Timestamp} time
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 SDK.MultitargetNetworkManager.Events = { 913 SDK.MultitargetNetworkManager.Events = {
898 ConditionsChanged: Symbol('ConditionsChanged'), 914 ConditionsChanged: Symbol('ConditionsChanged'),
899 UserAgentChanged: Symbol('UserAgentChanged') 915 UserAgentChanged: Symbol('UserAgentChanged')
900 }; 916 };
901 917
902 918
903 /** 919 /**
904 * @type {!SDK.MultitargetNetworkManager} 920 * @type {!SDK.MultitargetNetworkManager}
905 */ 921 */
906 SDK.multitargetNetworkManager; 922 SDK.multitargetNetworkManager;
OLDNEW
« 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