Last active
January 3, 2016 04:19
-
-
Save ph3nx/8407835 to your computer and use it in GitHub Desktop.
Two code examples on how to display all request headers in Ruby on Rails.
This file contains 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
<% request.header do |k, v| %> | |
"<%= k %>" => <%= v %><br> | |
<% end %> | |
<% for header in request.env.select {|k,v| k.match("^HTTP.*")} %> | |
"<%=header[0].split('_',2)[1]%>" => <%=header[1]%><br> | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment