h2c: fixed a bug, when the upgrade request already had the final response, and it was trying to repeat the request (identify the case and exit early)

This commit is contained in:
HoneyryderChuck 2018-02-24 13:20:53 +00:00
parent cfe712ca01
commit 33423f9774

View File

@ -29,6 +29,11 @@ module HTTPX
parser.upgrade(upgrade_request, upgrade_response, **options)
data = upgrade_response.to_s
parser << data
response = upgrade_request.response
if response.status == 200
requests.delete(upgrade_request)
return response if requests.empty?
end
responses = __send_reqs(*requests)
else
# proceed as usual