Skip to content

Instantly share code, notes, and snippets.

@garmoshka-mo
Created October 12, 2016 14:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garmoshka-mo/364297fd72a1f9ec31926ad7a03c68d0 to your computer and use it in GitHub Desktop.
Save garmoshka-mo/364297fd72a1f9ec31926ad7a03c68d0 to your computer and use it in GitHub Desktop.
Trace HTTP headers & cookies
# config/application.rb
config.middleware.use "Loggo"
class Loggo
def initialize(app)
@app = app
end
def call(env)
request = ActionDispatch::Request.new(env)
puts request.cookies
puts env.select {|k,v| k.start_with? 'HTTP_'}
@app.call(env)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment