OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // The rules for header parsing were borrowed from Firefox: | 5 // The rules for header parsing were borrowed from Firefox: |
6 // http://lxr.mozilla.org/seamonkey/source/netwerk/protocol/http/src/nsHttpRespo
nseHead.cpp | 6 // http://lxr.mozilla.org/seamonkey/source/netwerk/protocol/http/src/nsHttpRespo
nseHead.cpp |
7 // The rules for parsing content-types were also borrowed from Firefox: | 7 // The rules for parsing content-types were also borrowed from Firefox: |
8 // http://lxr.mozilla.org/mozilla/source/netwerk/base/src/nsURLHelper.cpp#834 | 8 // http://lxr.mozilla.org/mozilla/source/netwerk/base/src/nsURLHelper.cpp#834 |
9 | 9 |
10 #include "net/http/http_response_headers.h" | 10 #include "net/http/http_response_headers.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 // not to be stored by caches. | 55 // not to be stored by caches. |
56 const char* const kChallengeResponseHeaders[] = { | 56 const char* const kChallengeResponseHeaders[] = { |
57 "www-authenticate", | 57 "www-authenticate", |
58 "proxy-authenticate" | 58 "proxy-authenticate" |
59 }; | 59 }; |
60 | 60 |
61 // These headers are cookie setting headers; | 61 // These headers are cookie setting headers; |
62 // not to be stored by caches or disclosed otherwise. | 62 // not to be stored by caches or disclosed otherwise. |
63 const char* const kCookieResponseHeaders[] = { | 63 const char* const kCookieResponseHeaders[] = { |
64 "set-cookie", | 64 "set-cookie", |
65 "set-cookie2" | 65 "set-cookie2", |
| 66 "clear-site-data", |
66 }; | 67 }; |
67 | 68 |
68 // By default, do not cache Strict-Transport-Security or Public-Key-Pins. | 69 // By default, do not cache Strict-Transport-Security or Public-Key-Pins. |
69 // This avoids erroneously re-processing them on page loads from cache --- | 70 // This avoids erroneously re-processing them on page loads from cache --- |
70 // they are defined to be valid only on live and error-free HTTPS | 71 // they are defined to be valid only on live and error-free HTTPS |
71 // connections. | 72 // connections. |
72 const char* const kSecurityStateHeaders[] = { | 73 const char* const kSecurityStateHeaders[] = { |
73 "strict-transport-security", | 74 "strict-transport-security", |
74 "public-key-pins" | 75 "public-key-pins" |
75 }; | 76 }; |
(...skipping 1237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1313 return true; | 1314 return true; |
1314 } | 1315 } |
1315 | 1316 |
1316 bool HttpResponseHeaders::IsChunkEncoded() const { | 1317 bool HttpResponseHeaders::IsChunkEncoded() const { |
1317 // Ignore spurious chunked responses from HTTP/1.0 servers and proxies. | 1318 // Ignore spurious chunked responses from HTTP/1.0 servers and proxies. |
1318 return GetHttpVersion() >= HttpVersion(1, 1) && | 1319 return GetHttpVersion() >= HttpVersion(1, 1) && |
1319 HasHeaderValue("Transfer-Encoding", "chunked"); | 1320 HasHeaderValue("Transfer-Encoding", "chunked"); |
1320 } | 1321 } |
1321 | 1322 |
1322 } // namespace net | 1323 } // namespace net |
OLD | NEW |