aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/http/request.rb
Commit message (Collapse)AuthorAgeFilesLines
...
* | use a request object in the session middlewareAaron Patterson2015-08-221-2/+2
| | | | | | | | | | This commit allows us to use one request object rather than allocating multiple request objects to deal with the session.
* | move more `@env` access to method callsAaron Patterson2015-08-221-16/+16
| | | | | | | | | | We're going to implement storing env values differently in the future, so let's disconnect these methods from the instance variables
* | move ORIGINAL_SCRIPT_NAME to the metaprogrammed methodsAaron Patterson2015-08-221-4/+1
| |
* | metaprogram the HTTP_X_REQUEST_ID methodAaron Patterson2015-08-221-6/+1
| | | | | | | | we're already doing this with a bunch of other header data.
* | use `body_stream` instead of getting the env value ourselvesAaron Patterson2015-08-221-1/+1
| | | | | | | | we have a method that knows how to get rack.input, so lets use that.
* | convert `@env` use to get / set headerAaron Patterson2015-08-221-16/+16
| | | | | | | | | | | | We need to abstract the internals of the request object away from this instance variable so that the values for `@env` can be calculated in a different way.
* | Refactor to remove controller class from route to requesteileencodes2015-08-221-0/+12
| | | | | | | | | | | | | | | | | | | | This refactoring moves the controller class name that was on the route set to the request. The purpose of this refactoring is for changes we need to move controller tests to integration tests, mainly being able to access the controller on the request instead of having to go through the router. [Eileen M. Uchitelle & Aaron Patterson]
* | pass a request object to the headers objectAaron Patterson2015-08-211-1/+1
| |
* | deprecate the env method on controller instancesAaron Patterson2015-08-071-1/+1
| | | | | | | | | | | | people should be accessing request information through the request object, not via the env hash. If they really really want at the env hash, then they can get it off the request.
* | stop using @_env in the controller instanceAaron Patterson2015-08-071-0/+8
| | | | | | | | | | | | | | Actions are processed through `dispatch`, so they should have the request set on them before any user land code can be executed. Lets stop setting _env on the controller, and give access to it through the `env` method.
* | refactor param parsing middleware to use request objectsAaron Patterson2015-08-071-0/+8
| | | | | | | | | | this is another place that we should stop directly accessing the env hash and let the request object take care of that for us
* | Fix documentation on ActionDispatch::RequestGabriel Sobrinho2015-08-061-1/+1
| |
* | use a request object to access info from env in GetIpAaron Patterson2015-08-061-1/+7
| | | | | | | | | | | | | | again, we want to hide the contents of `env` from the implementation. Allocate a request object to access the contents of env, but save allocations due to string literal allocations when accessing the env hash.
* | ask the request if we should show exceptionsAaron Patterson2015-08-061-0/+7
| | | | | | | | | | hide the env key in the request object so that other code doesn't need to know.
* | prevent string allocationsAaron Patterson2015-08-061-1/+1
| |
* | get the underlying REQUEST_METHOD from the superclassAaron Patterson2015-08-061-1/+1
| |
* | routes in the env via the request objectAaron Patterson2015-08-051-0/+4
| |
* | allocate a request object to avoid hash allocationsAaron Patterson2015-08-051-0/+4
| | | | | | | | | | This decouples the `call` method from knowing the SCRIPT_NAME key and offloads decisions about how to access script_name
* | rm `deep_munge`. You will live on in our hearts (and git history)Aaron Patterson2015-07-211-7/+2
| | | | | | | | | | Now that we have encoding strategies, we can just walk the params hash once to encode as HWIA, and remove nils.
* | A few documentation tweaks [ci skip]Robin Dupret2015-06-071-2/+2
| | | | | | | | [Robin Dupret & Shunsuke Aida]
* | Remove already defined methods in super class of ActionDispatch::Request classMehmet Emin İNAÇ2015-05-281-36/+0
| | | | | | | | | | | | | | These methods had defined in 2004 by dhh in initial commit and `ActionDispatch::Request` class has been inherited from `Rack::Request` class in 2009 by josh. In 2014 these methods and more of them defined in `Rack::Request` class so we don't need them anymore in rails codebase.
* | Documentation for ActionDispatch::Request form_data? method [ci skip]Mehmet Emin İNAÇ2015-05-271-0/+2
| |
* | Add missing nodocs and docs for ActionDispatch::Request [ci skip]Mehmet Emin İNAÇ2015-05-261-3/+5
| | | | | | | | add missing dot to end of the doc
* | Use memoization while accessing request headers for minimizing memory usageMehmet Emin İNAÇ2015-05-251-1/+1
| |
* | remove useless ivarAaron Patterson2015-05-231-1/+0
| | | | | | | | I should have deleted this earlier with 42e66fac38b54dd53d062fb5d3376218ed2ffdae
* | move request id manipulation to the request objectAaron Patterson2015-05-221-1/+13
| | | | | | | | this way we can keep the knowledge of `env` hash keys in one place.
* | Fix method signature of `parse_query` to match rackeileencodes2015-04-061-1/+1
|/ | | | | | | Recently rack was changed to have a second argument on the `parse_query` method (in rack/rack#781). Rails relies on this and it's `parse_query` method was complaining about missing the second argument. I changed the arguments to `*` so we don't have this issue in the future.
* ask the routes objects for its Rack env keyAaron Patterson2015-03-021-1/+1
| | | | | | this centralizes the logic for determining the script name key and drops object allocations when calling `engine_script_name` (which is called on each `url_for`).
* Prefer request_id over uuid and test the aliasRafael Mendonça França2015-02-201-4/+4
|
* Aliased the ActionDispatch::Request#uuid method with ↵David Ilizarov2015-02-201-0/+2
| | | | ActionDispatch::Request#request_id
* Remove deprecated `ActionDispatch::Request#deep_munge`Rafael Mendonça França2015-01-041-9/+0
|
* stop referencing `env` in url_forAaron Patterson2014-12-301-0/+4
| | | | | encapsulate env in the request so that we can eventually move away from the env hash
* use methods on the request rather than direct hash accessAaron Patterson2014-12-301-0/+8
| | | | this will help decouple us from using the rack env hash
* edit pass over all warningsXavier Noria2014-10-281-1/+1
| | | | | | | | | | | | | | | This patch uniformizes warning messages. I used the most common style already present in the code base: * Capitalize the first word. * End the message with a full stop. * "Rails 5" instead of "Rails 5.0". * Backticks for method names and inline code. Also, converted a few long strings into the new heredoc convention.
* Request#check_method no longer breaks when :en is not available localeStefan Henzen2014-10-091-1/+1
| | | | | | | | Request#check_method would use to_sentence(locale: :en), which breaks when I18n.available_locales does not include :en and I18n.enforce_available_locales is true (default). Inlined to_sentence functionality to solve this.
* Rescue Rack::Utils::ParameterTypeError instead of TypeErrorYuki Nishijima2014-09-131-2/+2
| | | | | | | | As of rack/rack@167b6480235ff00ed5f355698bf00ec2f250f72e, Rack raises Rack::Utils::ParameterTypeError which inherits TypeError. In terms of the behavior, Rescuing TypeError still works but this method shouldn't rescue if TypeError is raised for other reasons.
* Avoid duplicating routes for HEAD requests.Guo Xiang Tan2014-08-211-0/+6
| | | | | | | | Follow up to rails#15321 Instead of duplicating the routes, we will first match the HEAD request to HEAD routes. If no match is found, we will then map the HEAD request to GET routes.
* Protect against error when parsing parameters with Bad RequestRafael Mendonça França2014-08-191-2/+2
| | | | Related with #11795.
* use 'based on' instead of 'based off' [ci skip]Akshay Vishnoi2014-08-121-1/+1
|
* LOCALHOST definition should match any 127.0.0.0/8 addressEarl J St Sauver2014-07-181-1/+1
| | | | | | | | | | | | | | | The entire 127.0.0.0/8 range is assigned to the loopback address, not only 127.0.0.0/24. This patch allows ActionDispatch::Request::LOCALHOST to match any IPv4 127.0.0.0/8 loopback address. The only place that the #local? method was previously under test was in the show_expectations_test.rb file. I don't particularly like that that's implicitly where this code is under test, and I feel like I should move some of that testing code into the test/dispatch/request_test.rb file, but I wanted some feedback first. Credit goes to @sriedel for discovering the issue and adding the patch.
* makes it sound less misleadingShunsukeAida2014-07-021-2/+2
|
* Merge pull request #15349 from tgxworld/remove_duplicated_method_callRafael Mendonça França2014-06-031-2/+2
|\ | | | | Remove duplicated HashWithIndifferentAccess#with_indifferent_access.
| * Remove duplicated HashWithIndifferentAccess#with_indifferent_access.Guo Xiang Tan2014-05-261-2/+2
| |
* | move path_parameter encoding check to the request objectAaron Patterson2014-05-271-0/+11
|/
* Add RFC4791 MKCALENDAR methodkasper2014-05-151-1/+3
|
* [ci skip] Add documentation for original_fullpath.Lauro Caetano2014-03-111-0/+7
|
* Change deep_munge call to avoid deprecation warningCarlos Antonio da Silva2013-12-031-2/+2
|
* Deep Munge the parameters for GET and POSTMichael Koziarski2013-12-021-2/+2
| | | | | | | | The previous implementation of this functionality could be accidentally subverted by instantiating a raw Rack::Request before the first Rails::Request was constructed. Fixes CVE-2013-6417
* :scissors: [ci skip]Carlos Antonio da Silva2013-11-041-3/+0
|
* Code style for privacy indentionDavid Heinemeier Hansson2013-11-031-8/+8
|