Ruby on Rails
Saturday, October 18, 2014
I believe, there's inconsistency between how Rails and curl normalize header names.
If I do a `curl -H "some_header: value"` it will send the header as `HTTP_SOME_HEADER`. Then in Rails controller I would expect that header to be accessible as `request.headers[:some_header]`, but it's not. The culprit is in the `ActionDispatch::Http::Headers#env_name`, which doesn't adjust the header name if it contains an underscore.
Which of the two is correct? Do you think the issue could addressed in Rails?
-- If I do a `curl -H "some_header: value"` it will send the header as `HTTP_SOME_HEADER`. Then in Rails controller I would expect that header to be accessible as `request.headers[:some_header]`, but it's not. The culprit is in the `ActionDispatch::Http::Headers#env_name`, which doesn't adjust the header name if it contains an underscore.
Which of the two is correct? Do you think the issue could addressed in Rails?
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/e4f3233e-b4fa-4358-91bd-7b21b60f6b03%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment