OLD | NEW |
---|---|
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 Loading... | |
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 // The Secure attribute may only be set on cookies if coming from a secure | |
386 // connection. | |
387 if (response.url.asParsedURL().scheme !== 'https' && | |
388 'Set-Cookie' in response.headers) { | |
389 var cookies = SDK.CookieParser.parseSetCookie(this._manager._target, respo nse.headers['Set-Cookie']); | |
Mike West
2017/01/12 07:59:03
Oh, nice! We already have a parser! :)
| |
390 for (var i = 0; i < cookies.length; i++) { | |
391 if (cookies[i].secure()) { | |
392 Common.console.warn(Common.UIString( | |
393 'Set-Cookie for %s is ignored in response from url: %s. It is mark ed as secure, but the response url is insecure.', | |
394 cookies[i].name(), response.url)); | |
395 } | |
396 } | |
397 } | |
398 | |
385 this._updateNetworkRequestWithResponse(networkRequest, response); | 399 this._updateNetworkRequestWithResponse(networkRequest, response); |
386 | 400 |
387 this._updateNetworkRequest(networkRequest); | 401 this._updateNetworkRequest(networkRequest); |
388 this._manager.dispatchEventToListeners(SDK.NetworkManager.Events.ResponseRec eived, networkRequest); | 402 this._manager.dispatchEventToListeners(SDK.NetworkManager.Events.ResponseRec eived, networkRequest); |
389 } | 403 } |
390 | 404 |
391 /** | 405 /** |
392 * @override | 406 * @override |
393 * @param {!Protocol.Network.RequestId} requestId | 407 * @param {!Protocol.Network.RequestId} requestId |
394 * @param {!Protocol.Network.Timestamp} time | 408 * @param {!Protocol.Network.Timestamp} time |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
897 SDK.MultitargetNetworkManager.Events = { | 911 SDK.MultitargetNetworkManager.Events = { |
898 ConditionsChanged: Symbol('ConditionsChanged'), | 912 ConditionsChanged: Symbol('ConditionsChanged'), |
899 UserAgentChanged: Symbol('UserAgentChanged') | 913 UserAgentChanged: Symbol('UserAgentChanged') |
900 }; | 914 }; |
901 | 915 |
902 | 916 |
903 /** | 917 /** |
904 * @type {!SDK.MultitargetNetworkManager} | 918 * @type {!SDK.MultitargetNetworkManager} |
905 */ | 919 */ |
906 SDK.multitargetNetworkManager; | 920 SDK.multitargetNetworkManager; |
OLD | NEW |