1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

12 commits

Author SHA1 Message Date
Aaron Patterson
34fa6658dd pass a request object to the headers object 2015-08-21 11:21:10 -07:00
Aaron Patterson
c6cfcc6124 move header allocation to a helper method
I'm going to change the constructor, so it's easier to do it in one
place.
2015-08-21 11:21:10 -07:00
schneems
ca97ec5099 HTTP::Headers#key? correctly converts
Previously if you were looking for a given key, the header may incorrectly tell you that it did not exist even though it would return a valid value:

```ruby
env     = { "CONTENT_TYPE" => "text/plain" }
headers = ActionDispatch::Http::Headers.new(env)
headers["Content-Type"] 
# => "text/plain"

headers.key?("Content-Type")
# => false
```

This PR fixes that behavior by converting the key before checking for presence
2014-05-07 12:01:34 -05:00
Yves Senn
41a14dcd10 Http::Headers directly modifies the passed environment.
The env hash passed to `Http::Headers#new` must be in env format.
Also be aware that the passed hash is modified directly.

docs and test-cases for setting headers/env in functional tests.

Follow up to #9700.
2013-03-15 10:13:49 +01:00
Yves Senn
a709246d17 Http::Headers respects dotted env vars, symbols, headers with numbers. 2013-03-13 16:41:00 +01:00
Yves Senn
9af59b2468 allow headers and env to be passed in IntegrationTest.
Closes #6513.
2013-03-13 16:41:00 +01:00
Yves Senn
e2a5de2bb2 refactor, Http::Headers stores headers in env notation
Also:
cleanup, use consistent syntax for `Http::Header` and test.
2013-03-13 16:40:47 +01:00
Yves Senn
8945be464f Http::Headers respects headers that are not prefixed with HTTP_ 2013-03-13 16:27:47 +01:00
Aaron Patterson
b2debfb005 add test for fetch with a block 2012-10-18 15:22:58 -07:00
Aaron Patterson
6ea781c9a7 prefer composition over inheritence 2012-10-18 15:20:30 -07:00
Mark Turner
61ba0fe82c Enable ActionDispatch::Http::Headers to support fetch 2012-05-02 11:22:34 -07:00
Joshua Peek
85750f22c9 Move dispatch related tests into test/dispatch 2009-01-28 22:50:46 -06:00