class Her::Middleware::AcceptJSON
This middleware adds a “Accept: application/json” HTTP header
Public Instance Methods
add_header(headers)
click to toggle source
@private
# File lib/her/middleware/accept_json.rb, line 6 def add_header(headers) headers.merge! "Accept" => "application/json" end
call(env)
click to toggle source
@private
# File lib/her/middleware/accept_json.rb, line 11 def call(env) add_header(env[:request_headers]) @app.call(env) end