Created
October 12, 2016 14:44
-
-
Save garmoshka-mo/364297fd72a1f9ec31926ad7a03c68d0 to your computer and use it in GitHub Desktop.
Trace HTTP headers & cookies
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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