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

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

Issue 10365012: Update net::HttpUtil::IsSafeHeader() with two new headers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 8 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « chrome/test/data/extensions/api_test/downloads/test.js ('k') | net/http/http_util_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 return true; 309 return true;
310 } 310 }
311 311
312 namespace { 312 namespace {
313 // A header string containing any of the following fields will cause 313 // A header string containing any of the following fields will cause
314 // an error. The list comes from the XMLHttpRequest standard. 314 // an error. The list comes from the XMLHttpRequest standard.
315 // http://www.w3.org/TR/XMLHttpRequest/#the-setrequestheader-method 315 // http://www.w3.org/TR/XMLHttpRequest/#the-setrequestheader-method
316 const char* const kForbiddenHeaderFields[] = { 316 const char* const kForbiddenHeaderFields[] = {
317 "accept-charset", 317 "accept-charset",
318 "accept-encoding", 318 "accept-encoding",
319 "access-control-request-headers",
320 "access-control-request-method",
319 "connection", 321 "connection",
320 "content-length", 322 "content-length",
321 "cookie", 323 "cookie",
322 "cookie2", 324 "cookie2",
323 "content-transfer-encoding", 325 "content-transfer-encoding",
324 "date", 326 "date",
325 "expect", 327 "expect",
326 "host", 328 "host",
327 "keep-alive", 329 "keep-alive",
328 "origin", 330 "origin",
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 value_is_quoted_ = true; 858 value_is_quoted_ = true;
857 // Do not store iterators into this. See declaration of unquoted_value_. 859 // Do not store iterators into this. See declaration of unquoted_value_.
858 unquoted_value_ = HttpUtil::Unquote(value_begin_, value_end_); 860 unquoted_value_ = HttpUtil::Unquote(value_begin_, value_end_);
859 } 861 }
860 } 862 }
861 863
862 return true; 864 return true;
863 } 865 }
864 866
865 } // namespace net 867 } // namespace net
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/api_test/downloads/test.js ('k') | net/http/http_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698