1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

14 commits

Author SHA1 Message Date
Aaron Patterson
e16afe61ab stop applying default headers in ActionDispatch::Response
I'm making this change so that I can construct response objects that
*don't* have the default headers applied.  For example, I would like to
construct a response object from the return value of a controller.

If you need to construct a response object with the default headers,
then please use the alternate constructor:
`ActionDispatch::Response.create`
2015-09-23 15:48:01 -07:00
Aaron Patterson
4d4d764ab6 Rack implements redirect? so we don't need it
Rack [already implements `redirect?` on the response object](1569a985e1/lib/rack/response.rb (L141)) so we don't need to implement our own.
2015-07-14 11:22:35 -07:00
Genadi Samokovarov
8ed0b89bbd Revert work arounds for upstream Ruby 2.2.0 kwargs bug
The bug caused a segfault and you can find more info about it at:
https://bugs.ruby-lang.org/issues/10685.

We did a couple of work arounds, but 2.2.1 rolled out and those aren't
needed anymore.

Here are the reverted commits:

- Revert "Work around for upstream Ruby bug #10685",
  commit 707a433870.

- Revert "Fix segmentation fault in ActionPack tests",
  commit 22e0a22d5f.

I'm also bumping the Ruby version check to 2.2.1 to prevent future
segfaults.
2015-03-05 17:39:22 +02:00
Genadi Samokovarov
707a433870 Work around for upstream Ruby bug #10685
In f6e293ec54 we avoided a segfault in the
tests, however I think we should try to avoid the crash, as it may
happen in user code as well.

Here is what I distiled the bug down to:

```ruby
# Rails case - works on 2.0, 2.1; crashes on 2.2
require 'action_dispatch'

ActionDispatch::Response.new(200, "Content-Type" => "text/xml")

# General case - works on 2.0, 2.1; crashes on 2.2
def foo(optional = {}, default_argument: nil)
end

foo('quux' => 'bar')
```
2015-03-01 16:31:20 +02:00
Jeremy Kemper
f6e293ec54 Fix default headers in test responses
Fixes regression in #18423. Merge default headers for new responses,
but don't merge when creating a response from the last session request.

hat tip @senny ❤️
2015-02-25 09:49:25 -07:00
Jonas Baumann
0739480f45 Default headers, removed in controller actions, will not be reapplied to the test response. 2015-01-09 16:55:02 +01:00
John Firebaugh
308517e913 Don't duplicate Rack::Response functionality. [#5320 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-25 10:58:07 +02:00
Carlos Antonio da Silva
9532d746a9 Cleanup deprecations in Action Dispatch
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-06 13:41:12 +02:00
Evgeniy Dolzhenko
ccf9577aee Fix a bunch of minor spelling mistakes 2010-06-11 14:15:34 +04:00
Joshua Peek
1bd8a50a99 Deprecation notice for TestResponse#redirected_to 2010-01-30 12:26:49 -06:00
Joshua Peek
3fb623fa90 SessionRestoreError belongs in AD 2009-09-23 23:37:31 -05:00
Joshua Peek
a8b75c480f Functional test runner finalizes response just like the integration test runner. In both runners, the @response object will now behave the same.
Some functional tests will need to be updated if they are relying on preprocessed data on the response.
2009-05-02 14:57:40 -05:00
Joshua Peek
3900f4007e Deprecate assert_redirect_to's partial hash matching 2009-05-02 14:23:44 -05:00
Joshua Peek
00d1a57e9f Start moving TestRequest and TestResponse into ActionDispatch 2009-04-30 17:26:03 -05:00