Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
README request["SOME_HEADER"] documentation incorrect. #542
The README says:
request["SOME_HEADER"] # value of SOME_HEADER header
This is wrong. Rack doesn't put headers in the params hash, just form data and query strings. Sinatra doesn't override this, either.
As far as I can tell, the only way to get request headers is via
Yes, I've tested it. In the Rack Request docs, it says that  is a shortcut to 'request.params' hash. This is the GET and POST params hash and not the headers hash. So request["HTTP_REFERER"] returns a nil. However, request[:query] will return "Hello" provided the url is http://localhost/?query=Hello. I've tested the headers part am I'm sure about that. The second part is what I infer from the docs and Rack source.
Sorry about lack of proper formatting. My phone keypad doesn't have a backticks key.