diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/unit/http/validate_content_length_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/unit/http/validate_content_length_spec.rb b/spec/unit/http/validate_content_length_spec.rb index 37bf6c2180..85f8d92f78 100644 --- a/spec/unit/http/validate_content_length_spec.rb +++ b/spec/unit/http/validate_content_length_spec.rb @@ -119,6 +119,21 @@ describe Chef::HTTP::ValidateContentLength do end end + describe "with negative Content-Length header" do + let(:content_length_value) { "-1" } + + %w{direct streaming}.each do |req_type| + describe "when running #{req_type} request" do + let(:request_type) { req_type.to_sym } + + it "should skip validation and log for debug" do + run_content_length_validation + expect(debug_output).to include("HTTP server responded with a negative Content-Length header (-1), cannot identify truncated downloads.") + end + end + end + end + describe "with correct Content-Length header" do %w{direct streaming}.each do |req_type| describe "when running #{req_type} request" do |