| 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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |