mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-10-06 00:02:08 -04:00
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
28 lines
421 B
Ruby
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
|