diff --git a/httprl.module b/httprl.module index ff22f49901edc6476180a66be465ee946e9a209a..1fd1ed4c1dffec63d4f458959355b3dbabde4c74 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); }