Class: Rollbar::Scrubbers::URL

Inherits:
Object
  • Object
show all
Defined in:
lib/rollbar/scrubbers/url.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.call(*args) ⇒ Object



9
10
11
# File 'lib/rollbar/scrubbers/url.rb', line 9

def self.call(*args)
  new.call(*args)
end

Instance Method Details

#call(options = {}) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/rollbar/scrubbers/url.rb', line 13

def call(options = {})
  url = options[:url]
  return url unless Rollbar::LanguageSupport.can_scrub_url?

  filter(url,
         build_regex(options[:scrub_fields]),
         options[:scrub_user],
         options[:scrub_password],
         options.fetch(:randomize_scrub_length, true))
rescue => e
  Rollbar.logger.error("[Rollbar] There was an error scrubbing the url: #{e}, options: #{options.inspect}")
  url
end