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

Side by Side Diff: net/http/http_util.cc

Issue 11192045: Process only the first Strict-Transport-Security header. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Disable the tests in CF. Created 8 years, 1 month 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 | Annotate | Revision Log
OLDNEW
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
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 // STS specifies that UAs must not process any STS headers after the first
397 // one.
398 "strict-transport-security"
396 }; 399 };
397 for (size_t i = 0; i < arraysize(kNonCoalescingHeaders); ++i) { 400 for (size_t i = 0; i < arraysize(kNonCoalescingHeaders); ++i) {
398 if (LowerCaseEqualsASCII(name_begin, name_end, kNonCoalescingHeaders[i])) 401 if (LowerCaseEqualsASCII(name_begin, name_end, kNonCoalescingHeaders[i]))
399 return true; 402 return true;
400 } 403 }
401 return false; 404 return false;
402 } 405 }
403 406
404 bool HttpUtil::IsLWS(char c) { 407 bool HttpUtil::IsLWS(char c) {
405 return strchr(HTTP_LWS, c) != NULL; 408 return strchr(HTTP_LWS, c) != NULL;
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
917 value_is_quoted_ = true; 920 value_is_quoted_ = true;
918 // Do not store iterators into this. See declaration of unquoted_value_. 921 // Do not store iterators into this. See declaration of unquoted_value_.
919 unquoted_value_ = HttpUtil::Unquote(value_begin_, value_end_); 922 unquoted_value_ = HttpUtil::Unquote(value_begin_, value_end_);
920 } 923 }
921 } 924 }
922 925
923 return true; 926 return true;
924 } 927 }
925 928
926 } // namespace net 929 } // namespace net
OLDNEW
« no previous file with comments | « net/data/url_request_unittest/hsts-multiple-headers.html.mock-http-headers ('k') | net/url_request/url_request_http_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698