Module: Aikido::Zen::Scanners::SSRFScanner::Headers Private

Included in:
Request, Response
Defined in:
lib/aikido/zen/scanners/ssrf_scanner.rb

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

Instance Method Summary collapse

Instance Method Details

#headersHash<String, String>

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:

  • (Hash<String, String>)


178
179
180
181
182
183
184
185
# File 'lib/aikido/zen/scanners/ssrf_scanner.rb', line 178

def headers
  return @headers if @normalized_headers

  @headers
    .transform_keys!(&:downcase)
    .transform_values!(&@header_normalizer)
    .tap { @normalized_headers = true }
end

#initialize(headers:, header_normalizer: :to_s.to_proc) ⇒ Object

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.

Parameters:

  • headers (Hash<String, Object>)
  • header_normalizer (Proc{Object => String}) (defaults to: :to_s.to_proc)


171
172
173
174
175
# File 'lib/aikido/zen/scanners/ssrf_scanner.rb', line 171

def initialize(headers:, header_normalizer: :to_s.to_proc)
  @headers = headers.to_h
  @header_normalizer = header_normalizer
  @normalized_headers = false
end