allow connections to be closed before they even started, if some error coming from the parser requires it (can happen if user input is evaluated in httpx time and fails)

This commit is contained in:
HoneyryderChuck 2021-09-25 01:00:31 +01:00
parent eb5bdc1fe6
commit 1e4177a079

View File

@ -448,7 +448,7 @@ module HTTPX
end
parser.on(:close) do |force|
transition(:closing)
if force
if force || @state == :idle
transition(:closed)
emit(:close)
end