Class: GdsApi::GovukHeaderSniffer

Inherits:
Object
  • Object
show all
Defined in:
lib/gds_api/middleware/govuk_header_sniffer.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, header_name) ⇒ GovukHeaderSniffer

Returns a new instance of GovukHeaderSniffer.


5
6
7
8
# File 'lib/gds_api/middleware/govuk_header_sniffer.rb', line 5

def initialize(app, header_name)
  @app = app
  @header_name = header_name
end

Instance Method Details

#call(env) ⇒ Object


10
11
12
13
# File 'lib/gds_api/middleware/govuk_header_sniffer.rb', line 10

def call(env)
  GdsApi::GovukHeaders.set_header(readable_name, env[@header_name])
  @app.call(env)
end