summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormikeytown22012-12-27 03:22:00 (GMT)
committer mikeytown22012-12-27 03:22:00 (GMT)
commit25abd857600f987cbb2d160c51bb523dbe71943f (patch)
treebd7fb0ba1987804d42f8b2508a2b9eaf7c006858
parent6ff2886d68e3f2dbaf186282230830c5879a30b0 (diff)
Issue #1426854 by mikeytown2: If a range request was made, and a 200 was returned, transform it into a 206.
-rw-r--r--httprl.module6
1 files changed, 3 insertions, 3 deletions
diff --git a/httprl.module b/httprl.module
index ff22f49..1fd1ed4 100644
--- a/httprl.module
+++ b/httprl.module
@@ -1202,9 +1202,9 @@ function httprl_send_request($results = NULL) {
// Now that we have the headers, increase the chunk size.
$responses[$id]->chunk_size = $responses[$id]->options['chunk_size_read'];
- // If a range header is set and a 200 was returned, calculate how
- // many bytes need to be downloaded.
- if (!empty($responses[$id]->options['headers']['Range']) && $responses[$id]->code == 200) {
+ // If a range header is set, 200 was returned, and method is GET
+ // calculate how many bytes need to be downloaded.
+ if (!empty($responses[$id]->options['headers']['Range']) && $responses[$id]->code == 200 && $responses[$id]->method == 'GET') {
$responses[$id]->ranges = httprl_get_ranges($responses[$id]->options['headers']['Range']);
$responses[$id]->options['max_data_size'] = httprl_get_last_byte_from_range($responses[$id]->ranges);
}