aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch
Commit message (Collapse)AuthorAgeFilesLines
* Missing require string/filters for `squish`Akira Matsuda2016-11-151-0/+2
|
* Merge pull request #27007 from maclover7/jm-fix-26912Rafael Mendonça França2016-11-131-2/+2
|\ | | | | | | Don't error on an empty CONTENT_TYPE
| * Don't error on an empty CONTENT_TYPEJon Moss2016-11-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit prevents a possible issue wherein an empty CONTENT_TYPE header is sent in a request to a Rails application, and then `request.content_mime_type` would return `nil`. This is because the `has_content_type?` guard method was not properly checking the validity of a request's content type; it was only checking to see whether or not the header existed, not whether it had a value stored inside. Relatedly, after an internal discussion, it was determined that the `has_content_type?` method is not meant to be part of the public API, and is therefore changed to a `:nodoc:` method in this commit. The test for this behavior is a little bit ugly, for two reasons. One is that it was difficult to determine where to place the test... I figured the best place would be with the rest of the ParamsWrapper stuff, since that's where the original issue was. Also, we have to do some fancy footwork in calling `dispatch` on the test's controller manually... this is because `ActionController::TestCase` will throw an error if you try and pass in a nil content type, which is exactly what we are trying to test here... Because of that, we have to manually call in to the controller, and bypass the `post` request helper. Fixes #26912. This is a regression in behavior between Rails versions 4.2.x and 5.0.x, which was introduced via [this commit](https://github.com/rails/rails/commit/a9f28600e901b11a9222e34bfae8642bfb753186).
* | Merge pull request #26222 from vipulnsward/26134-fixRafael França2016-11-131-1/+5
|\ \ | | | | | | Format and send logs to logger.fatal from DebugExceptions
| * | Format and send logs to logger.fatal from DebugExceptions instead of calling ↵Vipul A M2016-11-121-1/+5
| |/ | | | | | | | | | | fatal multiple times. Expose tags_text from TaggedLogging to be used for log formatting Fixes #26134
* | Merge pull request #26905 from bogdanvlviv/docsAndrew White2016-11-134-5/+5
|\ \ | |/ |/| Add missing `+` around a some literals.
| * Add missing `+` around a some literals.bogdanvlviv2016-10-274-5/+5
| | | | | | | | | | | | Mainly around `nil` [ci skip]
* | Add more rubocop rules about whitespacesRafael Mendonça França2016-10-2923-45/+45
| |
* | Support plain loggers in DebugExceptionsGenadi Samokovarov2016-10-281-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | I have been seeing people setting `Logger` instances for `config.logger` and it blowing up on `rails/web-console` usage. Now, I doubt many folks are manually setting `ActionView::Base.logger`, but given that `DebugExceptions` is running in a pretty fragile environment already, having it crash (and being silent) in those cases can be pretty tricky to trace down. I'm proposing we verify whether the `ActionView::Base.logger` supports silencing before we try to do it, to save us the headache of tracing it down.
* | Fix :stopdoc: to :startdoc: [ci skip]Ryuta Kamizono2016-10-281-1/+1
| |
* | removes requires already present in active_support/railsXavier Noria2016-10-271-1/+0
| |
* | let Regexp#match? be globally availableXavier Noria2016-10-271-1/+0
| | | | | | | | | | | | Regexp#match? should be considered to be part of the Ruby core library. We are emulating it for < 2.4, but not having to require the extension is part of the illusion of the emulation.
* | Remove all Journey constant from public APIRafael Mendonça França2016-10-265-7/+17
|/ | | | | | There were never public API only there by mistake. [ci skip]
* HSTS subdomains is now true, so let's fix documentation [ci skip] (#26870)प्रथमेश Sonpatki2016-10-231-1/+1
| | | - Followup of fda5afeb
* Revert "Undefine assings in IntegrationTest"Rafael Mendonça França2016-10-211-2/+0
| | | | | | This reverts commit 5dde413e1d14c42eb87071db20d075a7b962cb01. Reason: The gem defines it so we don't need to remove
* /s/integrations/integration [ci skip] (#26801)प्रथमेश Sonpatki2016-10-161-1/+1
|
* Copy-edit the documentationRafael Mendonça França2016-10-151-4/+4
| | | | [ci skip]
* Make `process` a non-private method and update documentation.Zach Aysan2016-10-151-98/+100
|
* Remove deprecated support to non-keyword arguments in ↵Rafael Mendonça França2016-10-101-42/+11
| | | | | | `ActionDispatch::IntegrationTest`, `#process`, `#get`, `#post`, `#patch`, `#put`, `#delete`, and `#head`.
* Remove deprecated `ActionDispatch::IntegrationTest#*_via_redirect`.Rafael Mendonça França2016-10-101-53/+0
|
* Remove deprecated `ActionDispatch::IntegrationTest#xml_http_request`Rafael Mendonça França2016-10-101-32/+0
|
* Remove deprecated support for passing `:path` and route path as stings in ↵Rafael Mendonça França2016-10-101-12/+1
| | | | `ActionDispatch::Routing::Mapper#match`
* Remove deprecated support passing path as `nil` in ↵Rafael Mendonça França2016-10-101-5/+1
| | | | `ActionDispatch::Routing::Mapper#match`
* Remove deprecated `cache_control` argument from ↵Rafael Mendonça França2016-10-101-8/+1
| | | | `ActionDispatch::Static#initialize`
* Remove deprecated support to passing strings to the middleware stackRafael Mendonça França2016-10-101-20/+1
|
* Remove deprecated code in ssl middlewareRafael Mendonça França2016-10-101-21/+3
|
* Remove deprecated code in ActionDispatch::Session::SessionRestoreErrorRafael Mendonça França2016-10-101-11/+1
|
* Deprecated ActionDispatch::ParamsParser::ParamsParserRafael Mendonça França2016-10-104-33/+27
| | | | | | ActionDispatch::ParamsParser class was removed in favor of ActionDispatch::Http::Parameters so it is better to move the error constant to the new class.
* Remove deprecated ActionDispatch::ParamsParserRafael Mendonça França2016-10-101-12/+1
|
* Remove deprecated code in ActionDispatch::ParamsParser::ParseErrorRafael Mendonça França2016-10-101-17/+1
|
* Remove deprecated access to mime types through constantsRafael Mendonça França2016-10-101-26/+0
|
* Undefine assings in IntegrationTestRafael Mendonça França2016-10-071-0/+2
| | | | | assigns assert the state of a controller instance what should not be done in an integration test.
* [ci-skip] Swap method and its alias, format docAndrey Molchanov2016-10-041-3/+4
|
* Show an "unmatched constraints" error for mismatching and present paramsChris Carter2016-10-032-2/+6
| | | | | | | | | | | | Currently a misleading "missing required keys" error is thrown when a param fails to match the constraints of a particular route. This commit ensures that these params are recognised as unmatching rather than missing. Note: this means that a different error message will be provided between optimized and non-optimized path helpers, due to the fact that the former does not check constraints when matching routes. Fixes #26470.
* Only search fixture_path for files that can't be found directlyMatthew Draper2016-09-241-1/+2
| | | | | | | | | | When passed an already-valid file name, prepending the path is likely to create problems. This is particularly relevant for #26384, which adds fixture_path handling to test classes that previously didn't have it: any existing caller must have been manually locating the file, and we don't want to break them.
* Merge pull request #26589 from kirs/ad-test-request-methodArthur Nogueira Neves2016-09-221-1/+1
|\ | | | | Fix memoization bug on ActionDispatch::TestRequest#request_method=
| * Fix memoization bug on ActionDispatch::TestRequest#request_method=Kir Shatrov2016-09-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TestRequest have been overrriding request_method setter since 2009, but the actual implementation in Request (not TestRequest) has been changed since that. Now it's also using @request_method instance variable to keep the state. The override in TestRequest have not been calling `super`, which caused a bug that after accessing #requst_method the value was memoized and then we've never been able to change it anymore: ``` req = ActionDispatch::TestRequest.create puts "was: #{req.request_method}" # memoized here req.request_method = "POST" puts "became: #{req.request_method}" ``` output: ``` was: GET became: GET ``` Since the whole purpose of overriding the setter in TestRequest is to upcase it, I'm changing it to `super(method.to_s.upcase)`
* | Merge pull request #26477 from kirs/action_dispatch-assert_responseRafael França2016-09-141-1/+6
|\ \ | | | | | | Improve assert_response helper
| * | Improve assert_response helperKir Shatrov2016-09-141-1/+6
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the check is failed, print the actual response body if it's not too large. This could improve productivity when writing new tests. Before: ``` ThemeEditorIntegrationTest#test_whatever Expected response to be a <200: ok>, but was a <422: Unprocessable Entity>. Expected: 200 Actual: 422 ``` After: ``` ThemeEditorIntegrationTest#test_whatever Expected response to be a <200: ok>, but was a <422: Unprocessable Entity>. Expected: 200 Actual: 422 Response body: {"errors":["Invalid settings object for section '1'"]} ```
* / Fix broken comments indentation caused by rubocop auto-correct [ci skip]Ryuta Kamizono2016-09-143-26/+26
|/ | | | | | 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.
* Merge pull request #26384 from ↵Eileen M. Uchitelle2016-09-041-1/+3
|\ | | | | | | | | y-yagi/make_fixture_file_upload_in_integration_test make `fixture_file_upload` work in integration tests
| * make `fixture_file_upload` work in integration testsyuuji.yaginuma2016-09-041-1/+3
| | | | | | | | | | | | | | | | | | Currently, `fixture_file_upload` does not work in integration test. Because, `TestProcess` module has been include in `Session` class, but `fixture_path` can not get from `Session` class. Modify to include `TestProcess` in `IntegrationTest` class in order to get correct value of `fixture_path`.
* | Fix broken heredoc indentation caused by rubocop auto-correctRyuta Kamizono2016-09-032-2/+2
|/ | | | | | All indentation was normalized by rubocop auto-correct at 80e66cc4d90bf8c15d1a5f6e3152e90147f00772. But heredocs was still kept absolute position. This commit aligns heredocs indentation for consistency.
* RuboCop is 100% green :tada:Xavier Noria2016-09-021-10/+11
|
* fixes remaining RuboCop issues [Vipul A M, Xavier Noria]Xavier Noria2016-09-013-4/+4
|
* Start passing cipher from EncryptedCookieJar since we use it to determine ↵Vipul A M2016-09-011-7/+5
| | | | key length
* Follow up of #25602Vipul A M2016-09-011-4/+6
| | | | | | | | | Since keys are truncated, ruby 2.4 doesn't accept keys greater than their lenghts. keys of same value but different lenght and greater than key size of cipher, produce the same results as reproduced at https://gist.github.com/rhenium/b81355fe816dcfae459cc5eadfc4f6f9 Since our default cipher is 'aes-256-cbc', key length for which is 32 bytes, limit the length of key being passed to Encryptor to 32 bytes. This continues to support backwards compat with any existing signed data, already encrupted and signed with 32+ byte keys. Also fixes the passing of this value in multiple tests.
* Override `respond_to_missing?` instead of `respond_to?` when possibleSean Griffin2016-08-312-2/+2
| | | | | | | | | | This was almost every case where we are overriding `respond_to?` in a way that mirrors a parallel implementation of `method_missing`. There is one remaining case in Active Model that should probably do the same thing, but had a sufficiently strange implementation that I want to investigate it separately. Fixes #26333.
* Merge pull request #26317 from maclover7/jm-fix-26298Aaron Patterson2016-08-291-8/+15
|\ | | | | Allow `send_file` to declare a charset
| * Remove default argument, and extract internal convenience methodJon Moss2016-08-291-6/+12
| |