Update fix for HTTP Client
This commit is contained in:
parent
65a32d6e20
commit
53fbb257b9
1 changed files with 16 additions and 1 deletions
|
@ -199,7 +199,7 @@ class DenyFrame < Kemal::Handler
|
|||
end
|
||||
end
|
||||
|
||||
# Temp fix for https://github.com/crystal-lang/crystal/issues/7383
|
||||
# Temp fixes for https://github.com/crystal-lang/crystal/issues/7383
|
||||
class HTTP::UnknownLengthContent
|
||||
def read_byte
|
||||
ensure_send_continue
|
||||
|
@ -209,3 +209,18 @@ class HTTP::UnknownLengthContent
|
|||
@io.read_byte
|
||||
end
|
||||
end
|
||||
|
||||
class HTTP::Client
|
||||
private def handle_response(response)
|
||||
if @socket.is_a?(OpenSSL::SSL::Socket::Client)
|
||||
close unless response.keep_alive? || @socket.as(OpenSSL::SSL::Socket::Client).@in_buffer_rem.empty?
|
||||
if @socket.as(OpenSSL::SSL::Socket::Client).@in_buffer_rem.empty?
|
||||
@socket = nil
|
||||
end
|
||||
else
|
||||
close unless response.keep_alive?
|
||||
end
|
||||
|
||||
response
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue