Commit a5e14fa 1 parent fc5022f commit a5e14fa Copy full SHA for a5e14fa
File tree 2 files changed +3
-7
lines changed
2 files changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -88,13 +88,12 @@ def flush
88
88
89
89
# Value of the Content-Length header
90
90
#
91
- # @raise [HTTP::Error] if presented Content-Type value is not integer
92
91
# @return [Integer, nil]
93
92
def content_length
94
93
value = @headers [ Headers ::CONTENT_LENGTH ]
95
94
Integer ( value ) if value
96
95
rescue ArgumentError
97
- raise Error , "Invalid value of Content-Type: #{ value . inspect } "
96
+ nil
98
97
end
99
98
100
99
# Parsed Content-Type header
Original file line number Diff line number Diff line change 40
40
it { is_expected . to eq 5 }
41
41
end
42
42
43
- context "with Content-Length not an integer " do
43
+ context "with invalid Content-Length" do
44
44
let ( :headers ) { { "Content-Length" => "foo" } }
45
-
46
- it "raises an error" do
47
- expect { subject } . to raise_error ( HTTP ::Error )
48
- end
45
+ it { is_expected . to be_nil }
49
46
end
50
47
end
51
48
You can’t perform that action at this time.
0 commit comments