diff options
author | Noah Kantrowitz <noah@coderanger.net> | 2016-03-01 12:17:30 -0800 |
---|---|---|
committer | Noah Kantrowitz <noah@coderanger.net> | 2016-03-01 12:17:30 -0800 |
commit | 8b94d2346158f42e37ae0f54f65710e3122e8098 (patch) | |
tree | 5e306b8c402751b52e65264a163c7c63387ac03a /lib | |
parent | 55753254660c5a1a91eef45791989322dc186660 (diff) | |
parent | ba3ad73d90154934ec25eca3b5c5f17f5e11a437 (diff) | |
download | chef-8b94d2346158f42e37ae0f54f65710e3122e8098.tar.gz |
Merge pull request #4646 from coderanger/negative-length
Handle negative content length headers too.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/http/validate_content_length.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/chef/http/validate_content_length.rb b/lib/chef/http/validate_content_length.rb index 33b6d5a549..81d3b0fb74 100644 --- a/lib/chef/http/validate_content_length.rb +++ b/lib/chef/http/validate_content_length.rb @@ -91,6 +91,11 @@ class Chef return true end + if content_length < 0 + Chef::Log.debug "HTTP server responded with a negative Content-Length header (#{content_length}), cannot identify truncated downloads." + return true + end + # if Transfer-Encoding is set the RFC states that we must ignore the Content-Length field # CHEF-5041: some proxies uncompress gzip content, leave the incorrect content-length, but set the transfer-encoding field unless transfer_encoding.nil? |