Class: Request::CookieAuth

Inherits:
Faraday::Middleware
  • Object
show all
Defined in:
lib/faraday/cookie_auth.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, cookie) ⇒ CookieAuth

Returns a new instance of CookieAuth.



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

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

Instance Method Details

#call(env) ⇒ Object



5
6
7
8
# File 'lib/faraday/cookie_auth.rb', line 5

def call(env)
  env[:request_headers]['Cookie'] = @cookie
  @app.call(env)
end