Created
May 29, 2014 23:45
-
-
Save danhigham/aa00751f66e625cdd73f to your computer and use it in GitHub Desktop.
Simple rack app to show headers in a get request.
This file contains hidden or 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
| run Proc.new { |env| | |
| headers = env.select {|k,v| k.start_with? 'HTTP_'} | |
| .collect {|pair| [pair[0].sub(/^HTTP_/, ''), pair[1]]} | |
| .collect {|pair| pair.join(": ") << "<br>"} | |
| .sort | |
| [200, {"Content-Type" => "text/html"}, headers] | |
| } |
This file contains hidden or 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
| source 'https://rubygems.org' | |
| gem 'rack' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment