lib/httpx/plugins/proxy/http.rb in httpx-0.22.5 vs lib/httpx/plugins/proxy/http.rb in httpx-0.23.0
- old
+ new
@@ -59,11 +59,11 @@
@io.connect
return unless @io.connected?
@parser || begin
- @parser = registry(@io.protocol).new(@write_buffer, @options.merge(max_concurrent_requests: 1))
+ @parser = self.class.parser_type(@io.protocol).new(@write_buffer, @options.merge(max_concurrent_requests: 1))
parser = @parser
parser.extend(ProxyParser)
parser.on(:response, &method(:__http_on_connect))
parser.on(:close) { transition(:closing) }
parser.on(:reset) do
@@ -139,13 +139,13 @@
end
end
module ProxyParser
def join_headline(request)
- return super if request.verb == :connect
+ return super if request.verb == "CONNECT"
- "#{request.verb.to_s.upcase} #{request.uri} HTTP/#{@version.join(".")}"
+ "#{request.verb} #{request.uri} HTTP/#{@version.join(".")}"
end
def set_protocol_headers(request)
extra_headers = super
@@ -159,10 +159,10 @@
end
end
class ConnectRequest < Request
def initialize(uri, _options)
- super(:connect, uri, {})
+ super("CONNECT", uri, {})
@headers.delete("accept")
end
def path
"#{@uri.hostname}:#{@uri.port}"