Method: Webhookdb::Http.extract_url_auth
- Defined in:
- lib/webhookdb/http.rb
.extract_url_auth(url) ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/webhookdb/http.rb', line 40 def self.extract_url_auth(url) parsed_uri = URI(url) if parsed_uri.userinfo.present? auth_params = { username: URI.decode_www_form_component(parsed_uri.user || ""), password: URI.decode_www_form_component(parsed_uri.password || ""), } parsed_uri.user = parsed_uri.password = nil cleaned_url = parsed_uri.to_s return cleaned_url, auth_params end return url, nil end |