Class: Aikido::Zen::Scanners::SSRFScanner::Response Private

Inherits:
Object
  • Object
show all
Includes:
Headers
Defined in:
lib/aikido/zen/scanners/ssrf_scanner.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Headers

#headers

Constructor Details

#initialize(status:, **header_options) ⇒ Response

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Response.



212
213
214
215
# File 'lib/aikido/zen/scanners/ssrf_scanner.rb', line 212

def initialize(status:, **header_options)
  super(**header_options)
  @status = status.to_s
end

Instance Attribute Details

#statusObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



210
211
212
# File 'lib/aikido/zen/scanners/ssrf_scanner.rb', line 210

def status
  @status
end

Instance Method Details

#redirect?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


217
218
219
# File 'lib/aikido/zen/scanners/ssrf_scanner.rb', line 217

def redirect?
  @status.start_with?("3") && headers["location"]
end

#redirect_toObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



221
222
223
224
225
# File 'lib/aikido/zen/scanners/ssrf_scanner.rb', line 221

def redirect_to
  URI(headers["location"]) if redirect?
rescue URI::BadURIError
  nil
end