Module: RequestHeadersMiddleware

Extended by:
RequestHeadersMiddleware
Included in:
RequestHeadersMiddleware
Defined in:
lib/request_headers_middleware.rb,
lib/request_headers_middleware/railtie.rb,
lib/request_headers_middleware/version.rb,
lib/request_headers_middleware/middleware.rb,
lib/request_headers_middleware/faraday_adapter.rb

Overview

:nodoc:

Defined Under Namespace

Classes: FaradayAdapter, Middleware, Railtie

Constant Summary collapse

VERSION =
'0.0.6'

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#blacklistObject

Returns the value of attribute blacklist.



10
11
12
# File 'lib/request_headers_middleware.rb', line 10

def blacklist
  @blacklist
end

#callbacksObject

Returns the value of attribute callbacks.



10
11
12
# File 'lib/request_headers_middleware.rb', line 10

def callbacks
  @callbacks
end

#whitelistObject

Returns the value of attribute whitelist.



10
11
12
# File 'lib/request_headers_middleware.rb', line 10

def whitelist
  @whitelist
end

Instance Method Details

#setup(config) ⇒ Object



23
24
25
26
27
28
# File 'lib/request_headers_middleware.rb', line 23

def setup(config)
  @whitelist = config.whitelist.map { |key| key.downcase.to_sym } if config.whitelist
  @blacklist = config.blacklist.map { |key| key.downcase.to_sym } if config.blacklist

  config.callbacks && @callbacks = config.callbacks
end

#storeObject



15
16
17
# File 'lib/request_headers_middleware.rb', line 15

def store
  RequestStore[:headers] ||= {}
end

#store=(store) ⇒ Object



19
20
21
# File 'lib/request_headers_middleware.rb', line 19

def store=(store)
  RequestStore[:headers] = store
end