method
credential_filtered_uri
Ruby latest stable (v2_5_5)
-
0 notes -
Class: URICredentialsFilter
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125
- 1_9_3_392
- 2_1_10
- 2_2_9
- 2_4_6
- 2_5_5
- 2_6_3 (0)
- What's this?
credential_filtered_uri(uri_to_anonymize)
public
Hide source
# File lib/bundler/uri_credentials_filter.rb, line 7 def credential_filtered_uri(uri_to_anonymize) return uri_to_anonymize if uri_to_anonymize.nil? uri = uri_to_anonymize.dup uri = URI(uri.to_s) unless uri.is_a?(URI) if uri.userinfo # oauth authentication if uri.password == "x-oauth-basic" || uri.password == "x" # URI as string does not display with password if no user is set oauth_designation = uri.password uri.user = oauth_designation end uri.password = nil end return uri if uri_to_anonymize.is_a?(URI) return uri.to_s if uri_to_anonymize.is_a?(String) rescue URI::InvalidURIError # uri is not canonical uri scheme uri end