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.



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

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.



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

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)


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

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.



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

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