The title is pretty self-explanatory. Is there any way to get the headers (except for Rack::Request.env[])?
Based on @matt's answer, but this really gives you the request headers in a hash as requested in the question:
headers = Hash[*env.select {|k,v| k.start_with? 'HTTP_'}
.collect {|k,v| [k.sub(/^HTTP_/, ''), v]}
.collect {|k,v| [k.split('_').collect(&:capitalize).join('-'), v]}
.sort
.flatten]
Depending on what key convention you prefer you might want to use something else instead of :capitalize.