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.



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

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.



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

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)


228
229
230
# File 'lib/aikido/zen/scanners/ssrf_scanner.rb', line 228

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.



232
233
234
235
236
# File 'lib/aikido/zen/scanners/ssrf_scanner.rb', line 232

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