Module: Datadog::Core::Utils::Url

Defined in:
lib/datadog/core/utils/url.rb

Overview

Helpers class that provides methods to process URLs such as filtering sensitive information.

Class Method Summary collapse

Class Method Details

.filter_basic_auth(url) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/datadog/core/utils/url.rb', line 11

def self.filter_basic_auth(url)
  return nil if url.nil?

  URI(url).tap do |u|
    u.user = nil
    u.password = nil
  end.to_s
# Git scheme: [email protected]:DataDog/dd-trace-rb.git
rescue URI::InvalidURIError
  url
end