aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/show_exceptions_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Enable `Layout/EmptyLinesAroundAccessModifier` copRyuta Kamizono2019-06-131-1/+0
| | | | | | | | | | | We sometimes say "✂️ newline after `private`" in a code review (e.g. https://github.com/rails/rails/pull/18546#discussion_r23188776, https://github.com/rails/rails/pull/34832#discussion_r244847195). Now `Layout/EmptyLinesAroundAccessModifier` cop have new enforced style `EnforcedStyle: only_before` (https://github.com/rubocop-hq/rubocop/pull/7059). That cop and enforced style will reduce the our code review cost.
* Change `ActionDispatch::Response#content_type` returning Content-Type header ↵yuuji.yaginuma2019-06-011-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | as it is Since #35709, `Response#conten_type` returns only MIME type correctly. It is a documented behavior that this method only returns MIME type, so this change seems appropriate. https://github.com/rails/rails/blob/39de7fac0507070e3c5f8b33fbad6fced84d97ed/actionpack/lib/action_dispatch/http/response.rb#L245-L249 But unfortunately, some users expect this method to return all Content-Type that does not contain charset. This seems to be breaking changes. We can change this behavior with the deprecate cycle. But, in that case, a method needs that include Content-Type with additional parameters. And that method name is probably the `content_type` seems to properly. So I changed the new behavior to more appropriate `media_type` method. And `Response#content_type` changed (as the method name) to return Content-Type header as it is. Fixes #35709. [Rafael Mendonça França & Yuuji Yaginuma ]
* Only build middleware proxy when instrumentatingJohn Hawthorn2019-05-081-1/+1
| | | | | | | | | | | | | | | | | The instrumentation proxy adds three stack frames per-middleware, even when nothing is listening. This commit, when the middleware stack is built, only adds instrumentation when the `process_middleware.action_dispatch` event has already been subscribed to. The advantage to this is that we don't have any extra stack frames in apps which don't need middleware instrumentation. The disadvantage is that the subscriptions need to be in place when the middleware stack is built (during app boot). I think this is likely okay because temporary AS::Notifications subscriptions are strongly discouraged.
* Fix test broken by 04ae0b0b5e594e0bb99c5cd608921745977bcdcdRafael Mendonça França2019-03-191-3/+4
| | | | | This test was trying to set the exception_app in the wrapper proxy instead in the middleware itself.
* Use frozen string literal in actionpack/Kir Shatrov2017-07-291-0/+2
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* normalizes indentation and whitespace across the projectXavier Noria2016-08-061-3/+3
|
* modernizes hash syntax in actionpackXavier Noria2016-08-061-2/+2
|
* applies new string literal convention in actionpack/testXavier Noria2016-08-061-27/+27
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Fix failing tests for #19474Andrew White2015-03-231-2/+2
|
* Consistent usage of spaces in hashes across our codebaseRafael Mendonça França2015-01-291-6/+6
|
* Switch to kwargs in ActionController::TestCase and ActionDispatch::IntegrationKir Shatrov2015-01-291-6/+6
| | | | | | | | 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
* 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.
* Fix that JSON and XML exception responses should give the HTTP error message ↵Jeremy Kemper2013-05-081-2/+2
| | | | for their status, by default, not the message from the underlying exception
* Fix typos in AP: "overriden" => "overridden"Carlos Antonio da Silva2013-03-301-8/+8
|
* update documentation and code to use _action callbacksFrancesco Rodriguez2012-12-071-1/+1
|
* Add ensure block to make sure the state is properly restoredCarlos Antonio da Silva2012-11-041-1/+1
|
* Failsafe exception returns text/plain.Steve Klabnik2012-10-011-0/+16
| | | | | | | It's best to just return text/plain when something has gone terribly wrong. Fixes #5660.
* This consider_all_requests_local doesn't make senseSantiago Pastorino2012-06-121-18/+0
| | | | | This middleware is only for Public Exceptions. This follows bd8c0b8a
* Return proper format on exceptionsSantiago Pastorino2012-06-111-0/+43
|
* Show detailed exceptions no longer returns true if the request is local in ↵José Valim2011-12-161-1/+5
| | | | production.
* Extract the rendering of public exceptions pages into a Rack app.José Valim2011-12-161-1/+1
|
* Fix diagnostics page for routing errors.José Valim2011-12-151-3/+10
|
* Split ShowExceptions responsibilities in two middlewares.José Valim2011-12-011-0/+1
|
* Warnings removed. (ambiguous first argument)kennyj2011-11-241-3/+3
|
* move show_detailed_exceptions? to Rescue modulelest2011-11-221-2/+2
|
* refactor show exceptions testslest2011-11-221-0/+59