Fix monkeypatch for HTTP::Client

This commit is contained in:
Omar Roth committed 2019-10-26 11:51:23 -04:00
1 parent a1225b6d0d
commit bdeb325bad
3 files changed
+8 -4

No files matched your search

+2 -2
View File
@@ -226,15 +226,15 @@ end
class HTTP::Client
private def handle_response(response)
if @socket.is_a?(OpenSSL::SSL::Socket::Client)
if @socket.is_a?(OpenSSL::SSL::Socket::Client) && @host.ends_with? "googlevideo.com"
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
+5 -1
View File
@@ -1610,7 +1610,11 @@ struct HTTPPool
end
response = yield conn
conn.unset_proxy
if region
conn.unset_proxy
end
response
rescue ex
conn = HTTPClient.new(url)