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 parsing content-types were borrowed from Firefox: | 5 // The rules for parsing content-types were borrowed from Firefox: |
6 // http://lxr.mozilla.org/mozilla/source/netwerk/base/src/nsURLHelper.cpp#834 | 6 // http://lxr.mozilla.org/mozilla/source/netwerk/base/src/nsURLHelper.cpp#834 |
7 | 7 |
8 #include "net/http/http_util.h" | 8 #include "net/http/http_util.h" |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
385 const char* kNonCoalescingHeaders[] = { | 385 const char* kNonCoalescingHeaders[] = { |
386 "date", | 386 "date", |
387 "expires", | 387 "expires", |
388 "last-modified", | 388 "last-modified", |
389 "location", // See bug 1050541 for details | 389 "location", // See bug 1050541 for details |
390 "retry-after", | 390 "retry-after", |
391 "set-cookie", | 391 "set-cookie", |
392 // The format of auth-challenges mixes both space separated tokens and | 392 // The format of auth-challenges mixes both space separated tokens and |
393 // comma separated properties, so coalescing on comma won't work. | 393 // comma separated properties, so coalescing on comma won't work. |
394 "www-authenticate", | 394 "www-authenticate", |
395 "proxy-authenticate" | 395 "proxy-authenticate", |
396 // Perhaps incorrectly, Strict-Transport-Security specifies that UAs not | |
397 // process any STS headers after the first one. To enforce this, we must | |
398 // declare it non-coalescing. | |
Ryan Sleevi
2012/10/18 19:45:34
comment nit: A nit I inherited from mark@, which i
palmer
2012/10/18 21:01:58
Done.
| |
399 "strict-transport-security" | |
396 }; | 400 }; |
397 for (size_t i = 0; i < arraysize(kNonCoalescingHeaders); ++i) { | 401 for (size_t i = 0; i < arraysize(kNonCoalescingHeaders); ++i) { |
398 if (LowerCaseEqualsASCII(name_begin, name_end, kNonCoalescingHeaders[i])) | 402 if (LowerCaseEqualsASCII(name_begin, name_end, kNonCoalescingHeaders[i])) |
399 return true; | 403 return true; |
400 } | 404 } |
401 return false; | 405 return false; |
402 } | 406 } |
403 | 407 |
404 bool HttpUtil::IsLWS(char c) { | 408 bool HttpUtil::IsLWS(char c) { |
405 return strchr(HTTP_LWS, c) != NULL; | 409 return strchr(HTTP_LWS, c) != NULL; |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
917 value_is_quoted_ = true; | 921 value_is_quoted_ = true; |
918 // Do not store iterators into this. See declaration of unquoted_value_. | 922 // Do not store iterators into this. See declaration of unquoted_value_. |
919 unquoted_value_ = HttpUtil::Unquote(value_begin_, value_end_); | 923 unquoted_value_ = HttpUtil::Unquote(value_begin_, value_end_); |
920 } | 924 } |
921 } | 925 } |
922 | 926 |
923 return true; | 927 return true; |
924 } | 928 } |
925 | 929 |
926 } // namespace net | 930 } // namespace net |
OLD | NEW |