Skip to content

Instantly share code, notes, and snippets.

@kfatehi
Created August 4, 2013 06:02
Show Gist options
  • Save kfatehi/6149360 to your computer and use it in GitHub Desktop.
Save kfatehi/6149360 to your computer and use it in GitHub Desktop.
Rack app to dump environment
#!/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