| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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" |
| (...skipping 1273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1284 | 1284 |
| 1285 // We have all the values; let's verify that they make sense for a 206 | 1285 // We have all the values; let's verify that they make sense for a 206 |
| 1286 // response. | 1286 // response. |
| 1287 if (*first_byte_position < 0 || *last_byte_position < 0 || | 1287 if (*first_byte_position < 0 || *last_byte_position < 0 || |
| 1288 *instance_length < 0 || *instance_length - 1 < *last_byte_position) | 1288 *instance_length < 0 || *instance_length - 1 < *last_byte_position) |
| 1289 return false; | 1289 return false; |
| 1290 | 1290 |
| 1291 return true; | 1291 return true; |
| 1292 } | 1292 } |
| 1293 | 1293 |
| 1294 bool HttpResponseHeaders::IsChunkEncoded() const { |
| 1295 // Ignore spurious chunked responses from HTTP/1.0 servers and proxies. |
| 1296 return GetHttpVersion() >= HttpVersion(1, 1) && |
| 1297 HasHeaderValue("Transfer-Encoding", "chunked"); |
| 1298 } |
| 1299 |
| 1294 } // namespace net | 1300 } // namespace net |
| OLD | NEW |