summaryrefslogtreecommitdiff
path: root/lib/chef/http
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2014-01-27 16:14:35 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2014-01-27 16:14:35 -0800
commit12f2badc66d88bdd6199a44aa403dcdc02ffc168 (patch)
tree30b9947b09feeac209ea5100023c56d06c7fd2bf /lib/chef/http
parent963c3d55ce11f5d00a59b216e026d1bf87e7217a (diff)
downloadchef-12f2badc66d88bdd6199a44aa403dcdc02ffc168.tar.gz
rename ValidateResponse to ValidateContentLength
Diffstat (limited to 'lib/chef/http')
-rw-r--r--lib/chef/http/validate_content_length.rb (renamed from lib/chef/http/validate_response.rb)7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/chef/http/validate_response.rb b/lib/chef/http/validate_content_length.rb
index 1eaef3fa91..37305be756 100644
--- a/lib/chef/http/validate_response.rb
+++ b/lib/chef/http/validate_content_length.rb
@@ -22,8 +22,11 @@ require 'chef/log'
class Chef
class HTTP
- # Middleware that takes an HTTP response, parses it as JSON if possible.
- class ValidateResponse
+ # Middleware that validates the Content-Length header against the downloaded number of bytes.
+ #
+ # This must run before the decompressor middleware, since otherwise we will count the uncompressed
+ # streamed bytes, rather than the on-the-wire compressed bytes.
+ class ValidateContentLength
class ContentLengthCounter
attr_accessor :content_length