summaryrefslogtreecommitdiff
path: root/lib/chef/http/validate_content_length.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/http/validate_content_length.rb')
-rw-r--r--lib/chef/http/validate_content_length.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/chef/http/validate_content_length.rb b/lib/chef/http/validate_content_length.rb
index 076194e31a..77fb6194ef 100644
--- a/lib/chef/http/validate_content_length.rb
+++ b/lib/chef/http/validate_content_length.rb
@@ -16,8 +16,8 @@
# limitations under the License.
#
-require 'pp'
-require 'chef/log'
+require "pp"
+require "chef/log"
class Chef
class HTTP
@@ -73,18 +73,18 @@ class Chef
private
def response_content_length(response)
- return nil if response['content-length'].nil?
- if response['content-length'].is_a?(Array)
- response['content-length'].first.to_i
+ return nil if response["content-length"].nil?
+ if response["content-length"].is_a?(Array)
+ response["content-length"].first.to_i
else
- response['content-length'].to_i
+ response["content-length"].to_i
end
end
def validate(http_response, response_length)
content_length = response_content_length(http_response)
- transfer_encoding = http_response['transfer-encoding']
- content_encoding = http_response['content-encoding']
+ transfer_encoding = http_response["transfer-encoding"]
+ content_encoding = http_response["content-encoding"]
if content_length.nil?
Chef::Log.debug "HTTP server did not include a Content-Length header in response, cannot identify truncated downloads."