lib/httpx/plugins/proxy/http.rb in httpx-0.14.0 vs lib/httpx/plugins/proxy/http.rb in httpx-0.14.1
- old
+ new
@@ -80,14 +80,15 @@
def headline_uri(request)
request.uri.to_s
end
def set_protocol_headers(request)
- super
+ extra_headers = super
+
proxy_params = @options.proxy
- request.headers["proxy-authorization"] = "Basic #{proxy_params.token_authentication}" if proxy_params.authenticated?
- request.headers["proxy-connection"] = request.headers["connection"]
- request.headers.delete("connection")
+ extra_headers["proxy-authorization"] = "Basic #{proxy_params.token_authentication}" if proxy_params.authenticated?
+ extra_headers["proxy-connection"] = extra_headers.delete("connection") if extra_headers.key?("connection")
+ extra_headers
end
end
class ConnectProxyParser < ProxyParser
attr_reader :pending