Created
August 4, 2013 06:02
-
-
Save kfatehi/6149360 to your computer and use it in GitHub Desktop.
Rack app to dump environment
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'rack' | |
class RequestDump | |
def call(env) | |
html = "<html><body>" | |
env.each do |key,val| | |
html << "<p>Key: #{key}<br>" | |
html << " Value: #{val}</p>" | |
end | |
html << "<body></html>" | |
[200, {"Content-Type"=>"text/html"}, [html]] | |
end | |
end | |
map '/' do | |
run RequestDump.new | |
end | |
# gem install rack | |
# rackup | |
# screenshot http://cl.ly/image/09193v1f393c | |
# written for stumpped here http://stackoverflow.com/questions/17847576/how-to-view-debug-non-standard-request-headers-my-phones-browser-is-sending/17915352#17915352 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment