Class: Sqreen::PayloadCreator::HeaderSection

Inherits:
Object
  • Object
show all
Defined in:
lib/sqreen/payload_creator/header_section.rb

Overview

object that default to call on framework header

Instance Method Summary collapse

Constructor Details

#initialize(framework) ⇒ HeaderSection

Returns a new instance of HeaderSection.



14
15
16
# File 'lib/sqreen/payload_creator/header_section.rb', line 14

def initialize(framework)
  @framework = framework
end

Instance Method Details

#[](value) ⇒ Object



18
19
20
21
22
23
# File 'lib/sqreen/payload_creator/header_section.rb', line 18

def [](value)
  if %w[rack_client_ip rails_client_ip ip_headers].include?(value)
    return @framework.send(value)
  end
  @framework.header(value)
end

#ip_headersObject



25
26
27
# File 'lib/sqreen/payload_creator/header_section.rb', line 25

def ip_headers
  @framework.ip_headers
end