module CMSScanner::Browser::Actions

Browser Actions (get, post etc)

Public Instance Methods

forge_request(url, params = {}) click to toggle source

@param [ String ] url @param [ Hash ] params

@return [ Typhoeus::Request ]

# File lib/cms_scanner/browser/actions.rb, line 11
def forge_request(url, params = {})
  NS::Browser.instance.forge_request(url, params)
end
get(url, params = {}) click to toggle source

@param [ String ] url @param [ Hash ] params

@return [ Typhoeus::Response ]

# File lib/cms_scanner/browser/actions.rb, line 19
def get(url, params = {})
  forge_request(url, params.merge(method: :get)).run
end
get_and_follow_location(url, params = {}) click to toggle source

@param [ String ] url @param [ Hash ] params

@return [ Typhoeus::Response ]

# File lib/cms_scanner/browser/actions.rb, line 43
def get_and_follow_location(url, params = {})
  get(url, { followlocation: true, maxredirs: 3 }.merge(params))
end
head(url, params = {}) click to toggle source

@param [ String ] url @param [ Hash ] params

@return [ Typhoeus::Response ]

# File lib/cms_scanner/browser/actions.rb, line 35
def head(url, params = {})
  forge_request(url, params.merge(method: :head)).run
end
post(url, params = {}) click to toggle source

@param [ String ] url @param [ Hash ] params

@return [ Typhoeus::Response ]

# File lib/cms_scanner/browser/actions.rb, line 27
def post(url, params = {})
  forge_request(url, params.merge(method: :post)).run
end