File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -142,6 +142,7 @@ def [](field)
142
142
# Sets the response header +field+ to +value+
143
143
144
144
def []=( field , value )
145
+ @chunked = value . to_s . downcase == 'chunked' if field . downcase == 'transfer-encoding'
145
146
@header [ field . downcase ] = value . to_s
146
147
end
147
148
Original file line number Diff line number Diff line change @@ -133,6 +133,13 @@ def test_1xx_does_not_log_warnings
133
133
assert_equal 0 , logger . messages . length
134
134
end
135
135
136
+ def test_200_chunked_does_not_set_content_length
137
+ res . chunked = false
138
+ res [ "Transfer-Encoding" ] = 'chunked'
139
+ res . setup_header
140
+ assert_nil res . header . fetch ( 'content-length' , nil )
141
+ end
142
+
136
143
def test_send_body_io
137
144
IO . pipe { |body_r , body_w |
138
145
body_w . write 'hello'
You can’t perform that action at this time.
0 commit comments