Created
July 4, 2011 11:52
-
-
Save mfilej/1063262 to your computer and use it in GitHub Desktop.
inspect-headers.herokuapp.com – prints HTTP request headers (an excuse to try out heroku cedar)
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
require "stringio" | |
require "bundler" | |
Bundler.require | |
run ->(env) { | |
body = StringIO.new | |
env.sort.each do |(k, v)| | |
next unless k =~ /^HTTP_(\w+)/ | |
header = $1.split("_").map(&:capitalize).join("-") | |
body.puts "#{header}: #{v}" | |
end | |
body.rewind | |
[200, { "Content-Type" => "text/plain" }, body] | |
} |
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 :rubygems | |
gem "rack", "~> 1.3.0" | |
gem "thin", "~> 1.2.7" |
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
GEM | |
remote: http://rubygems.org/ | |
specs: | |
daemons (1.1.0) | |
eventmachine (0.12.10) | |
rack (1.3.0) | |
thin (1.2.11) | |
daemons (>= 1.0.9) | |
eventmachine (>= 0.12.6) | |
rack (>= 1.0.0) | |
PLATFORMS | |
ruby | |
DEPENDENCIES | |
rack (~> 1.3.0) | |
thin (~> 1.2.7) |
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
web: bundle exec thin start -p $PORT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment