The title is pretty self-explanatory. Is there any way to get the headers (except for Rack::Request.env[])?
The title is pretty self-explanatory. Is there any way to get the headers (except
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The HTTP headers are available in the Rack environment passed to your app:
So the HTTP headers are prefixed with “HTTP_” and added to the hash.
Here’s a little program that extracts and displays them:
When I run this, in addition to the HTTP headers as shown by Chrome or Firefox, there is a “VERSION: HTPP/1.1” (i.e. an entry with key “HTTP_VERSION” and value “HTTP/1.1” is being added to the env hash).