mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
Deal with zero sized bodies properly when using SSL. Fixes #1483
This commit is contained in:
parent
b9ff900eee
commit
61c875f0de
2 changed files with 3 additions and 1 deletions
|
@ -81,6 +81,8 @@ module Puma
|
||||||
end
|
end
|
||||||
|
|
||||||
def write(data)
|
def write(data)
|
||||||
|
return 0 if data.empty?
|
||||||
|
|
||||||
need = data.bytesize
|
need = data.bytesize
|
||||||
|
|
||||||
while true
|
while true
|
||||||
|
|
|
@ -755,8 +755,8 @@ module Puma
|
||||||
|
|
||||||
begin
|
begin
|
||||||
res_body.each do |part|
|
res_body.each do |part|
|
||||||
|
next if part.bytesize.zero?
|
||||||
if chunked
|
if chunked
|
||||||
next if part.bytesize.zero?
|
|
||||||
fast_write client, part.bytesize.to_s(16)
|
fast_write client, part.bytesize.to_s(16)
|
||||||
fast_write client, line_ending
|
fast_write client, line_ending
|
||||||
fast_write client, part
|
fast_write client, part
|
||||||
|
|
Loading…
Add table
Reference in a new issue