Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
require 'rubygems'
require 'sinatra'
helpers do
def request_headers
env.inject({}){|acc, (k,v)| acc[$1.downcase] = v if k =~ /^http_(.*)/i; acc}
end
end
get '/headers' do
puts request_headers.inspect
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment