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 header parsing were borrowed from Firefox: | 5 // The rules for header parsing were borrowed from Firefox: |
6 // http://lxr.mozilla.org/seamonkey/source/netwerk/protocol/http/src/nsHttpRespo
nseHead.cpp | 6 // http://lxr.mozilla.org/seamonkey/source/netwerk/protocol/http/src/nsHttpRespo
nseHead.cpp |
7 // The rules for parsing content-types were also borrowed from Firefox: | 7 // The rules for parsing content-types were also borrowed from Firefox: |
8 // http://lxr.mozilla.org/mozilla/source/netwerk/base/src/nsURLHelper.cpp#834 | 8 // http://lxr.mozilla.org/mozilla/source/netwerk/base/src/nsURLHelper.cpp#834 |
9 | 9 |
10 #include "net/http/http_response_headers.h" | 10 #include "net/http/http_response_headers.h" |
11 | 11 |
12 #include <algorithm> | 12 #include <algorithm> |
13 | 13 |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/metrics/histogram.h" | 15 #include "base/metrics/histogram.h" |
16 #include "base/pickle.h" | 16 #include "base/pickle.h" |
17 #include "base/strings/string_number_conversions.h" | 17 #include "base/strings/string_number_conversions.h" |
18 #include "base/strings/string_piece.h" | 18 #include "base/strings/string_piece.h" |
19 #include "base/strings/string_util.h" | 19 #include "base/strings/string_util.h" |
20 #include "base/strings/stringprintf.h" | 20 #include "base/strings/stringprintf.h" |
21 #include "base/time.h" | 21 #include "base/time/time.h" |
22 #include "base/values.h" | 22 #include "base/values.h" |
23 #include "net/base/escape.h" | 23 #include "net/base/escape.h" |
24 #include "net/http/http_util.h" | 24 #include "net/http/http_util.h" |
25 | 25 |
26 using base::StringPiece; | 26 using base::StringPiece; |
27 using base::Time; | 27 using base::Time; |
28 using base::TimeDelta; | 28 using base::TimeDelta; |
29 | 29 |
30 namespace net { | 30 namespace net { |
31 | 31 |
(...skipping 1316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1348 return true; | 1348 return true; |
1349 } | 1349 } |
1350 | 1350 |
1351 bool HttpResponseHeaders::IsChunkEncoded() const { | 1351 bool HttpResponseHeaders::IsChunkEncoded() const { |
1352 // Ignore spurious chunked responses from HTTP/1.0 servers and proxies. | 1352 // Ignore spurious chunked responses from HTTP/1.0 servers and proxies. |
1353 return GetHttpVersion() >= HttpVersion(1, 1) && | 1353 return GetHttpVersion() >= HttpVersion(1, 1) && |
1354 HasHeaderValue("Transfer-Encoding", "chunked"); | 1354 HasHeaderValue("Transfer-Encoding", "chunked"); |
1355 } | 1355 } |
1356 | 1356 |
1357 } // namespace net | 1357 } // namespace net |
OLD | NEW |