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

Side by Side Diff: net/http/http_response_headers.h

Issue 251213004: HttpServer: avoid DCHECK'ing on non-HTTP/1.1 requests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rm spurious nl Created 6 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
« no previous file with comments | « no previous file | net/http/http_response_headers.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 #ifndef NET_HTTP_HTTP_RESPONSE_HEADERS_H_ 5 #ifndef NET_HTTP_HTTP_RESPONSE_HEADERS_H_
6 #define NET_HTTP_HTTP_RESPONSE_HEADERS_H_ 6 #define NET_HTTP_HTTP_RESPONSE_HEADERS_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 // The members of this structure point into raw_headers_. 328 // The members of this structure point into raw_headers_.
329 struct ParsedHeader; 329 struct ParsedHeader;
330 typedef std::vector<ParsedHeader> HeaderList; 330 typedef std::vector<ParsedHeader> HeaderList;
331 331
332 HttpResponseHeaders(); 332 HttpResponseHeaders();
333 ~HttpResponseHeaders(); 333 ~HttpResponseHeaders();
334 334
335 // Initializes from the given raw headers. 335 // Initializes from the given raw headers.
336 void Parse(const std::string& raw_input); 336 void Parse(const std::string& raw_input);
337 337
338 // Helper function for ParseStatusLine.
339 // Tries to extract the "HTTP/X.Y" from a status line formatted like:
340 // HTTP/1.1 200 OK
341 // with line_begin and end pointing at the begin and end of this line. If the
342 // status line is malformed, returns HttpVersion(0,0).
343 static HttpVersion ParseVersion(std::string::const_iterator line_begin,
344 std::string::const_iterator line_end);
345
346 // Tries to extract the status line from a header block, given the first 338 // Tries to extract the status line from a header block, given the first
347 // line of said header block. If the status line is malformed, we'll 339 // line of said header block. If the status line is malformed, we'll
348 // construct a valid one. Example input: 340 // construct a valid one. Example input:
349 // HTTP/1.1 200 OK 341 // HTTP/1.1 200 OK
350 // with line_begin and end pointing at the begin and end of this line. 342 // with line_begin and end pointing at the begin and end of this line.
351 // Output will be a normalized version of this. 343 // Output will be a normalized version of this.
352 void ParseStatusLine(std::string::const_iterator line_begin, 344 void ParseStatusLine(std::string::const_iterator line_begin,
353 std::string::const_iterator line_end, 345 std::string::const_iterator line_end,
354 bool has_headers); 346 bool has_headers);
355 347
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 417
426 // The parsed http version number (not normalized). 418 // The parsed http version number (not normalized).
427 HttpVersion parsed_http_version_; 419 HttpVersion parsed_http_version_;
428 420
429 DISALLOW_COPY_AND_ASSIGN(HttpResponseHeaders); 421 DISALLOW_COPY_AND_ASSIGN(HttpResponseHeaders);
430 }; 422 };
431 423
432 } // namespace net 424 } // namespace net
433 425
434 #endif // NET_HTTP_HTTP_RESPONSE_HEADERS_H_ 426 #endif // NET_HTTP_HTTP_RESPONSE_HEADERS_H_
OLDNEW
« no previous file with comments | « no previous file | net/http/http_response_headers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698