Class: Frodo::Middleware::CustomHeaders

Inherits:
Frodo::Middleware show all
Defined in:
lib/frodo/middleware/custom_headers.rb

Overview

Middleware that allows you to specify custom request headers when initializing Frodo client

Instance Method Summary collapse

Methods inherited from Frodo::Middleware

#client, #connection, #initialize

Constructor Details

This class inherits a constructor from Frodo::Middleware

Instance Method Details

#call(env) ⇒ Object



7
8
9
10
11
12
# File 'lib/frodo/middleware/custom_headers.rb', line 7

def call(env)
  headers = @options[:request_headers]
  env[:request_headers].merge!(headers) if headers.is_a?(Hash)

  @app.call(env)
end