diff options
author | Noah Kantrowitz <noah@coderanger.net> | 2016-02-29 15:34:15 -0800 |
---|---|---|
committer | Noah Kantrowitz <noah@coderanger.net> | 2016-02-29 15:34:15 -0800 |
commit | b4b8120191de45f5f8f8611dde244fde714b1004 (patch) | |
tree | 698b8c7b85afaafede57ebcfbdf1a5f7a3e78e51 /lib | |
parent | c824aa564fa1a193d76b47fa430742c0a756eaa2 (diff) | |
download | chef-b4b8120191de45f5f8f8611dde244fde714b1004.tar.gz |
Split the negative check to its own log message.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/http/validate_content_length.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/chef/http/validate_content_length.rb b/lib/chef/http/validate_content_length.rb index 17219a7c89..81d3b0fb74 100644 --- a/lib/chef/http/validate_content_length.rb +++ b/lib/chef/http/validate_content_length.rb @@ -86,11 +86,16 @@ class Chef transfer_encoding = http_response["transfer-encoding"] content_encoding = http_response["content-encoding"] - if content_length.nil? || content_length < 0 + if content_length.nil? Chef::Log.debug "HTTP server did not include a Content-Length header in response, cannot identify truncated downloads." 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? |