lib/httpx/connection/http1.rb in httpx-0.20.5 vs lib/httpx/connection/http1.rb in httpx-0.21.0
- old
+ new
@@ -116,11 +116,11 @@
headers)
log(color: :yellow) { "-> HEADLINE: #{response.status} HTTP/#{@parser.http_version.join(".")}" }
log(color: :yellow) { response.headers.each.map { |f, v| "-> HEADER: #{f}: #{v}" }.join("\n") }
@request.response = response
- on_complete if response.complete?
+ on_complete if response.finished?
end
def on_trailers(h)
return unless @request
@@ -156,9 +156,10 @@
request = @request
@request = nil
@requests.shift
response = request.response
+ response.finish!
emit(:response, request, response)
if @parser.upgrade?
response << @parser.upgrade_data
throw(:called)