aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/request
Commit message (Collapse)AuthorAgeFilesLines
* Deprecate :controller and :action path parametersAndrew White2016-03-014-7/+21
| | | | | | | | Allowing :controller and :action values to be specified via the path in config/routes.rb has been an underlying cause of a number of issues in Rails that have resulted in security releases. In light of this it's better that controllers and actions are explicitly whitelisted rather than trying to blacklist or sanitize 'bad' values.
* Revert "Merge pull request #20851 from tomprats/indifferent-sessions"Matthew Draper2016-02-261-10/+0
| | | | | | | This reverts commit 22db455dbe9c26fe6d723cac0758705d9943ea4b, reversing changes made to 40be61dfda1e04c3f306022a40370862e3a2ce39. This finishes off what I meant to do in 6216a092ccfe6422f113db906a52fe8ffdafdbe6.
* Revert "Update Session to utilize indiffernt access"Matthew Draper2016-02-261-1/+1
| | | | | | | | | | | This reverts commit 45a75a3fcc96b22954caf69be2df4e302b134d7a. HWIAs are better than silently deeply-stringified hashes... but that's a reaction to a shortcoming of one particular session store: we should not break the basic behaviour of other, more featureful, session stores in the process. Fixes #23884
* Merge pull request #20851 from tomprats/indifferent-sessionsRafael Mendonça França2016-02-241-0/+10
|\ | | | | | | Give Sessions Indifferent Access
| * Update Session to utilize indiffernt accessTom Prats2016-01-301-1/+1
| |
| * Update session to have indifferent accessTom Prats2016-01-291-0/+10
| |
* | Make sure we unregister the mime type before registeringRafael Mendonça França2016-02-221-10/+22
| | | | | | | | Also make sure we don't change the global state of our test suite.
* | Use symbol of mime type instead of object to get correct parserMehmet Emin İNAÇ2016-02-221-0/+16
| | | | | | | | | | | | After registering new `:json` mime type `parsers.fetch` can't find the mime type because new mime type is not equal to old one. Using symbol of the mime type as key on parsers hash solves the problem. Closes #23766
* | Fix typoRafael Mendonça França2016-02-171-1/+1
| |
* | The JSON API media type should only work wih a JSON API handlerBenjamin Fleischer2016-02-161-9/+2
|/ | | | | | | | | | | | Since the media type 'application/vnd.api+json' is a spec, it is inappropriate to handle it with the JSON renderer. This PR removes support for a JSON API media type. I would recommend the media type be registered on its own as `jsonapi` when a jsonapi Renderer and deserializer (Http::Parameters::DEFAULT_PARSERS) are added. Is related to work in https://github.com/rails/rails/pull/21496
* Push `before_sending` to super classeileencodes2015-12-061-1/+1
| | | | | | | | | | | | We want to get rid of the `Live::Response` so we are consolidating methods from `Live::Response` and `Response` by merging them together. This adds an `#empty` method to the request so we don't need to hard-code the empty array each time we call an empty `ActionDispatch::Request`. The work here is a continuation on combining controller and integration test code bases into one.
* Deprecate exception#original_exception in favor of exception#causeYuki Nishijima2015-11-031-2/+2
|
* Merge pull request #21251 from rodzyn/more_param_parser_testsSean Griffin2015-10-301-0/+14
|\ | | | | Add test for parsing application/vnd.api+json
| * Add test for parsing application/vnd.api+jsonMarcin Olichwirowicz2015-08-211-0/+14
| |
* | implement abstract store methodsAaron Patterson2015-09-041-1/+1
| | | | | | | | converts old ID methods to the new abstract store methods in Rack
* | use a request object in the session middlewareAaron Patterson2015-08-221-19/+21
|/ | | | | This commit allows us to use one request object rather than allocating multiple request objects to deal with the session.
* point at rack masterAaron Patterson2015-08-201-1/+1
|
* Add failing spec on utf8 filename with percent characterKohei Suzuki2015-08-041-0/+11
|
* Stop using deprecated `render :text` in testPrem Sichanugrist2015-07-171-1/+1
| | | | | | | | | This will silence deprecation warnings. Most of the test can be changed from `render :text` to render `:plain` or `render :body` right away. However, there are some tests that needed to be fixed by hand as they actually assert the default Content-Type returned from `render :body`.
* Make AC::Parameters not inherited from HashPrem Sichanugrist2015-07-151-1/+1
| | | | | | | | This is another take at #14384 as we decided to wait until `master` is targeting Rails 5.0. This commit is implementation-complete, as it guarantees that all the public methods on the hash-inherited Parameters are still working (based on test case). We can decide to follow-up later if we want to remove some methods out from Parameters.
* Removed magic comments # encoding: utf-8 , since its default from ruby 2.0 ↵Vipul A M2015-02-031-1/+0
| | | | onwards.
* Consistent usage of spaces in hashes across our codebaseRafael Mendonça França2015-01-293-3/+3
|
* Switch to kwargs in ActionController::TestCase and ActionDispatch::IntegrationKir Shatrov2015-01-294-16/+15
| | | | | | | | Non-kwargs requests are deprecated now. Guides are updated as well. `post url, nil, nil, { a: 'b' }` doesn't make sense. `post url, params: { y: x }, session: { a: 'b' }` would be an explicit way to do the same
* Don't convert empty arrays to nils when deep munging paramsChris Sinjakli2014-12-152-4/+4
|
* Merge pull request #13999 from jamox/update_rackAaron Patterson2014-07-081-1/+5
|\ | | | | This updates rails to use edge rack
| * Upgraded rackJarmo Isotalo2014-05-191-1/+5
| | | | | | | | | | | | | | | | As Rack has some non backwards compatible changes added required modifications to keep behaviour in rails close to same as before. Also modified generators to include rack/rack for not yet released version of rack
* | Avoid hardcoded value in test setup/teardown.Zuhao Wan2014-06-051-1/+2
| |
* | Merge pull request #15349 from tgxworld/remove_duplicated_method_callRafael Mendonça França2014-06-031-4/+1
|\ \ | | | | | | Remove duplicated HashWithIndifferentAccess#with_indifferent_access.
| * | Remove duplicated HashWithIndifferentAccess#with_indifferent_access.Guo Xiang Tan2014-05-261-4/+1
| |/
* / Routes specifying 'to:' must be a string that contains a "#" or a rackAaron Patterson2014-06-031-2/+2
|/ | | | | application. Use of a symbol should be replaced with `action: symbol`. Use of a string without a "#" should be replaced with `controller: string`.
* Cleaning and adding tests for SessionAttila Domokos2014-03-191-7/+34
| | | Adding tests for Session `destroy`, `update` and `delete` methods. No changes for code under test.
* test boolean and number json param parsingArthur Neves2014-01-231-0/+7
|
* Merge pull request #13188 from imanel/skip_deep_mungeJeremy Kemper2013-12-191-0/+15
|\ | | | | | | | | | | | | Add configuration option to optionally disable deep_munge Conflicts: actionpack/CHANGELOG.md
| * Add configuration option to optionally disable deep_mungeBernard Potocki2013-12-051-0/+15
| |
* | Make ActionDispatch::Request::Session#fetch behave like Hash#fetchTrent Ogren2013-12-111-3/+2
|/ | | | | | Session#fetch was mutating the session when given a default argument and/or a block. Since Session duck-types as a Hash, it should behave like one in these cases.
* Deep Munge the parameters for GET and POSTMichael Koziarski2013-12-021-0/+15
| | | | | | | | 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
* session#fetch doesn't behave exactly like Hash#fetch.Damien Mathieu2013-10-301-1/+5
| | | | | | | | | Mention it in the changelog and add a test checking for regressions. Hash#fetch isn't adding the defaultly returned value. However, in the session, saving it is the behavior we should expect. See discussion in #12692
* add the fetch method to sessionsDamien Mathieu2013-10-291-0/+13
|
* Use Request#raw_post instead Request#bodyPaul Nikitochkin2013-07-081-0/+7
| | | | | | | | In order to get raw_post to be not empty after ParamsParser#parse_formatted_parameters, added rewinding of body stream input on parsing json params. Closes #11345
* Cleanup ul_encoded_params_parsing_testGenadi Samokovarov2013-07-051-25/+27
|
* use bytesize rather than force encodingAaron Patterson2013-06-281-2/+1
|
* Replace multi_json with jsonErik Michaels-Ober2013-05-111-1/+1
|
* Fix failing AP testCarlos Antonio da Silva2013-05-011-1/+1
|
* UTF-8 encode all keys and values in nested params hash.Teo Hui Ming2013-03-151-1/+20
|
* Change from each to each_value on hash to avoid unused variable warningVipul A M2013-03-111-1/+1
|
* Remove XML Parser from ActionDispatchPrem Sichanugrist2013-02-201-182/+0
| | | | | If you want an ability to parse XML parameters, please install `actionpack-xml_parser` gem.
* Fix json params parsing regression for non-object JSON content.Dylan Smith2013-01-111-0/+7
| | | | Fixes #8845.
* Remove :yaml related tests and fix other related to parsing empty arraysCarlos Antonio da Silva2013-01-081-2/+2
| | | | All Action Pack tests are green.
* * Strip nils from collections on JSON and XML posts. [CVE-2013-0155] * ↵Aaron Patterson2013-01-082-0/+32
| | | | | | | | | | | | dealing with empty hashes. Thanks Damien Mathieu Conflicts: actionpack/CHANGELOG.md actionpack/lib/action_dispatch/http/request.rb actionpack/lib/action_dispatch/middleware/params_parser.rb activerecord/CHANGELOG.md activerecord/lib/active_record/relation/predicate_builder.rb activerecord/test/cases/relation/where_test.rb
* Revert "Merge branch 'master-sec'"Jeremy Kemper2013-01-082-32/+0
| | | | | This reverts commit 88cc1688d0cb828c17706b41a8bd27870f2a2beb, reversing changes made to f049016cd348627bf8db0d72382d7580bf802a79.