class Gorilla::Middleware::UserAgent

Public Class Methods

new(app, agent_string) click to toggle source
Calls superclass method
# File lib/gorilla/middleware/user_agent.rb, line 4
def initialize(app, agent_string)
  super(app)
  @agent_string = agent_string
end

Public Instance Methods

call(env) click to toggle source
# File lib/gorilla/middleware/user_agent.rb, line 9
def call(env)
  env[:request_headers]['User-Agent'] = @agent_string
  @app.call(env)
end