aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/http/headers.rb
Commit message (Collapse)AuthorAgeFilesLines
* Fix broken comments indentation caused by rubocop auto-correct [ci skip]Ryuta Kamizono2016-09-141-2/+2
| | | | | | All indentation was normalized by rubocop auto-correct at 80e66cc4d90bf8c15d1a5f6e3152e90147f00772. But comments was still kept absolute position. This commit aligns comments with method definitions for consistency.
* Missing key should throw KeyErroreileencodes2016-08-261-1/+1
| | | | | | It should not throw a NameError, but should throw a KeyError. Fixes #26278
* Given a hash (Rails 5) .from_hash must be usedJavier Julio2016-08-121-1/+1
| | | When initializing an `ActionDispatch::Http::Headers` object it takes a request object (Rails 5) whereas before it took a hash (Rails 4.x) but the documented example still shows a hash given to the constructor (due to commit 34fa6658dd1b779b21e586f01ee64c6f59ca1537) so this is just a documentation change to use the new `from_hash` method introduced in that earlier commit.
* normalizes indentation and whitespace across the projectXavier Noria2016-08-061-7/+7
|
* applies new string literal convention in actionpack/libXavier Noria2016-08-061-1/+1
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Fix typo in headers commentGrey Baker2016-03-291-1/+1
|
* Change 'a HTTP' to 'an HTTP' [ci skip]Santosh Wadghule2016-03-031-1/+1
|
* Add additional documentation on Headers#[] [ci skip]Tawan Sierek2016-01-291-1/+15
| | | | | | | | | | | | | | | | | | | | Issue #16519 covers confusion potentially caused by how HTTP headers, that contain underscores in their names, are retrieved through `ActionDispatch::Http::Headers#[]`. This confusion has its origin in how a CGI maps HTTP header names to variable names. Even though underscores in header names are rarely encountered, they are valid according to RFC822 [1]. Nonetheless CGI like variable names, as requested by the Rack specfication, will only contain underscores and therefore the original header name cannot be recovered after the Rack server passed on the environemnt hash. Please, see also the disscussion on StackOverflow [2], which also links to an explaination in the nginx documentation [3]. [1] http://www.ietf.org/rfc/rfc822.txt [2] http://stackoverflow.com/questions/22856136/why-underscores-are-forbidden-in-http-header-names [3] https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/#missing-disappearing-http-headers
* Introduce `Headers#add`. Move `Response#add_header` upstream.Jeremy Daer2015-10-031-0/+5
| | | | | | | * Introduce `ActionDispatch::Http::Headers#add` to add a value to a multivalued header. * Move `Response#add_header` upstream: https://github.com/rack/rack/pull/957 * Match upstream `Response#have_header?` -> `#has_header?` name change.
* stop inheriting from Rack::RequestAaron Patterson2015-09-041-1/+1
| | | | | | Just include the modules necessary in the Request object to implement the things we need. This should make it easier to build delegate request objects because the API is smaller
* use methods on the request object to implement `fetch`Aaron Patterson2015-08-211-2/+8
| | | | Now the Headers internals don't depend on the env hash.
* dup the env hash on Header#envAaron Patterson2015-08-211-1/+1
| | | | | This prevents external mutations from impacting the internals of the request or the Header object.
* use accessors on the request object for manipulating envAaron Patterson2015-08-211-3/+3
| | | | | this reduces the API footprint for the env hash so that we can be more flexible when changing API in the future
* use `set_header` rather than []=Aaron Patterson2015-08-211-1/+1
| | | | This allows us to avoid calling `env_name` twice.
* dup the request and mutate its headers object.Aaron Patterson2015-08-211-2/+2
| | | | duping the request will dup it's underlying env hash.
* pass a request object to the headers objectAaron Patterson2015-08-211-9/+15
|
* Use a frozen Set instance for CGI_VARIABLES.Nathaniel Bibler2014-06-051-8/+21
| | | Also expand the CGI_VARIABLE name listing to multiple lines for cleaner diffs and legibility.
* Merge branch 'master' of github.com:rails/docrailsVijay Dev2014-05-101-1/+22
|\
| * copy edits [ci skip]Vijay Dev2014-05-101-8/+8
| |
| * [ci skip] doc Http::Headers methodsschneems2014-05-091-1/+17
| |
| * copy edits [ci skip]Vijay Dev2014-05-081-2/+1
| |
| * [ci skip] document ActionDispatch::HTTP::Headersschneems2014-05-071-0/+6
| |
* | HTTP::Headers#key? correctly convertsschneems2014-05-071-1/+3
|/ | | | | | | | | | | | | | | 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
* `Http::Headers` directly modifies the passed environment.Yves Senn2013-03-151-2/+1
| | | | | | | | | 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.
* `Http::Headers` respects dotted env vars, symbols, headers with numbers.Yves Senn2013-03-131-11/+6
|
* allow headers and env to be passed in `IntegrationTest`.Yves Senn2013-03-131-1/+15
| | | | Closes #6513.
* refactor, `Http::Headers` stores headers in env notationYves Senn2013-03-131-17/+21
| | | | | Also: cleanup, use consistent syntax for `Http::Header` and test.
* Http::Headers respects headers that are not prefixed with HTTP_Yves Senn2013-03-131-1/+13
|
* move cache inside the instance so we do not need lockingAaron Patterson2012-10-181-9/+12
|
* add test for fetch with a blockAaron Patterson2012-10-181-2/+2
|
* prefer composition over inheritenceAaron Patterson2012-10-181-11/+15
|
* Enable ActionDispatch::Http::Headers to support fetchMark Turner2012-05-021-7/+8
|
* Unneeded require memoizableAkira Matsuda2011-11-121-2/+0
|
* Remove usage of memoizable from ActionPack.José Valim2011-06-161-3/+3
|
* Silence some trivial warnings: shadowed local vars, indentation mismatchesJeremy Kemper2009-12-281-7/+7
|
* Move HTTP libs and middleware into ActionDispatch componentJoshua Peek2009-01-271-0/+33