Method: BrowserMob::Proxy::Client#whitelist
- Defined in:
- lib/browsermob/proxy/client.rb
#whitelist(regexp, status_code) ⇒ Object
Set a list of URL regexes to whitelist
Note that passed regexp/string should match string as a whole (i.e. if /example.com/ is whitelisted “www.example.com” won’t be allowed though if /.+example.com“ is whitelisted ”www.example.com“ will be allowed)
91 92 93 94 |
# File 'lib/browsermob/proxy/client.rb', line 91 def whitelist(regexp, status_code) regex = Array(regexp).map { |rx| Regexp === rx ? rx.source : rx.to_s }.join(',') @resource['whitelist'].put :regex => regex, :status => status_code end |