moved check o expect-100 response to the headers callback, as in http2, it doesn't close the stream when waiting for the body (I have no idea how this was working)

This commit is contained in:
HoneyryderChuck 2020-04-18 17:43:21 +01:00
parent e7181132ab
commit 1b97001b5f

View File

@ -205,6 +205,8 @@ module HTTPX
response = request.options.response_class.new(request, status, "2.0", headers)
request.response = response
@streams[request] = stream
handle(request, stream) if request.expects?
end
def on_stream_data(stream, request, data)
@ -214,8 +216,6 @@ module HTTPX
end
def on_stream_close(stream, request, error)
return handle(request, stream) if request.expects?
if error && error != :no_error
ex = Error.new(stream.id, error)
ex.set_backtrace(caller)