| 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 #include "net/http/http_request_headers.h" | 5 #include "net/http/http_request_headers.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/strings/string_split.h" | 8 #include "base/strings/string_split.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 headers->AddHeaderFromString(header_line); | 235 headers->AddHeaderFromString(header_line); |
| 236 } | 236 } |
| 237 return true; | 237 return true; |
| 238 } | 238 } |
| 239 | 239 |
| 240 HttpRequestHeaders::HeaderVector::iterator | 240 HttpRequestHeaders::HeaderVector::iterator |
| 241 HttpRequestHeaders::FindHeader(const base::StringPiece& key) { | 241 HttpRequestHeaders::FindHeader(const base::StringPiece& key) { |
| 242 for (HeaderVector::iterator it = headers_.begin(); | 242 for (HeaderVector::iterator it = headers_.begin(); |
| 243 it != headers_.end(); ++it) { | 243 it != headers_.end(); ++it) { |
| 244 if (key.length() == it->key.length() && | 244 if (key.length() == it->key.length() && |
| 245 !base::strncasecmp(key.data(), it->key.data(), key.length())) | 245 !strncasecmp(key.data(), it->key.data(), key.length())) |
| 246 return it; | 246 return it; |
| 247 } | 247 } |
| 248 | 248 |
| 249 return headers_.end(); | 249 return headers_.end(); |
| 250 } | 250 } |
| 251 | 251 |
| 252 HttpRequestHeaders::HeaderVector::const_iterator | 252 HttpRequestHeaders::HeaderVector::const_iterator |
| 253 HttpRequestHeaders::FindHeader(const base::StringPiece& key) const { | 253 HttpRequestHeaders::FindHeader(const base::StringPiece& key) const { |
| 254 for (HeaderVector::const_iterator it = headers_.begin(); | 254 for (HeaderVector::const_iterator it = headers_.begin(); |
| 255 it != headers_.end(); ++it) { | 255 it != headers_.end(); ++it) { |
| 256 if (key.length() == it->key.length() && | 256 if (key.length() == it->key.length() && |
| 257 !base::strncasecmp(key.data(), it->key.data(), key.length())) | 257 !strncasecmp(key.data(), it->key.data(), key.length())) |
| 258 return it; | 258 return it; |
| 259 } | 259 } |
| 260 | 260 |
| 261 return headers_.end(); | 261 return headers_.end(); |
| 262 } | 262 } |
| 263 | 263 |
| 264 } // namespace net | 264 } // namespace net |
| OLD | NEW |