diff options
author | Jeremy Daer <jeremydaer@gmail.com> | 2015-10-03 22:05:01 -0700 |
---|---|---|
committer | Jeremy Daer <jeremydaer@gmail.com> | 2015-10-03 22:05:01 -0700 |
commit | 67597e1719ec6af7e22964603cc77aa5b085a864 (patch) | |
tree | a82b9781bd1c2efb85252e376fa9d27fc94d1f29 /actionpack/lib/action_dispatch/http/headers.rb | |
parent | 24b1850130c68fe70b912277527e9c139ccc6742 (diff) | |
parent | 2356403330f2fa60045c858434cad550f6b3ee46 (diff) | |
download | rails-67597e1719ec6af7e22964603cc77aa5b085a864.tar.gz rails-67597e1719ec6af7e22964603cc77aa5b085a864.tar.bz2 rails-67597e1719ec6af7e22964603cc77aa5b085a864.zip |
Merge pull request #21861 from jeremy/rack-add-header
Introduce `Headers#add`. Move `Response#add_header` upstream.
Diffstat (limited to 'actionpack/lib/action_dispatch/http/headers.rb')
-rw-r--r-- | actionpack/lib/action_dispatch/http/headers.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/http/headers.rb b/actionpack/lib/action_dispatch/http/headers.rb index 9a3aaca3f0..12f81dc1a5 100644 --- a/actionpack/lib/action_dispatch/http/headers.rb +++ b/actionpack/lib/action_dispatch/http/headers.rb @@ -49,6 +49,11 @@ module ActionDispatch @req.set_header env_name(key), value end + # Add a value to a multivalued header like Vary or Accept-Encoding. + def add(key, value) + @req.add_header env_name(key), value + end + def key?(key) @req.has_header? env_name(key) end |