Module: Katello::Util::HttpProxy
- Defined in:
- app/lib/katello/util/http_proxy.rb
Instance Method Summary collapse
- #proxy ⇒ Object
- #proxy_host ⇒ Object
- #proxy_port ⇒ Object
- #proxy_scheme ⇒ Object
- #proxy_uri ⇒ Object
Instance Method Details
#proxy ⇒ Object
20 21 22 |
# File 'app/lib/katello/util/http_proxy.rb', line 20 def proxy ::HttpProxy.default_global_content_proxy end |
#proxy_host ⇒ Object
24 25 26 |
# File 'app/lib/katello/util/http_proxy.rb', line 24 def proxy_host URI(proxy.url).host end |
#proxy_port ⇒ Object
32 33 34 |
# File 'app/lib/katello/util/http_proxy.rb', line 32 def proxy_port URI(proxy.url).port end |
#proxy_scheme ⇒ Object
28 29 30 |
# File 'app/lib/katello/util/http_proxy.rb', line 28 def proxy_scheme URI(proxy.url).scheme end |
#proxy_uri ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/lib/katello/util/http_proxy.rb', line 4 def proxy_uri #Reset the scheme to proxy(s) based on http or https to handle cgi unescaping in rest-client if proxy scheme = 'proxy' if proxy_scheme == 'http' scheme = 'proxys' if proxy_scheme == 'https' uri = URI("#{scheme}://#{proxy_host}:#{proxy_port}") if proxy && proxy.username.present? uri.user = CGI.escape(proxy.username) uri.password = CGI.escape(proxy.password) end uri.to_s end end |