httpx/test/support/proxy_response_detector.rb
HoneyryderChuck 6b9a737756 introducing Connection#peer to point to the host to connect to
this eliminates the overuse of Connection#origin, which in the case of proxied connections was broken in the previous commit

the proxy implementation got simpler, despite this large changeset
2024-11-19 12:55:44 +00:00

28 lines
421 B
Ruby

# frozen_string_literal: true
module ProxyResponseDetector
module RequestMethods
attr_writer :proxied
def proxied?
@proxied
end
end
module ResponseMethods
def proxied?
@request.proxied?
end
end
module ConnectionMethods
def send(request)
return super unless @options.respond_to?(:proxy) && @options.proxy
request.proxied = true
super
end
end
end