From 8ed0b89bbdfa73740e00ddb2a001e0df947b6ef9 Mon Sep 17 00:00:00 2001 From: Genadi Samokovarov Date: Thu, 5 Mar 2015 15:53:49 +0200 Subject: 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 707a433870e9e06af688f85a4aedc64a90791a64. - Revert "Fix segmentation fault in ActionPack tests", commit 22e0a22d5f98e162290d9820891d8191e720ad3b. I'm also bumping the Ruby version check to 2.2.1 to prevent future segfaults. --- actionpack/lib/action_dispatch/http/response.rb | 4 +--- actionpack/lib/action_dispatch/testing/test_response.rb | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'actionpack') diff --git a/actionpack/lib/action_dispatch/http/response.rb b/actionpack/lib/action_dispatch/http/response.rb index 5fe544c60c..a895d1ab18 100644 --- a/actionpack/lib/action_dispatch/http/response.rb +++ b/actionpack/lib/action_dispatch/http/response.rb @@ -113,9 +113,7 @@ module ActionDispatch # :nodoc: # The underlying body, as a streamable object. attr_reader :stream - # Ruby 2.2 bug https://bugs.ruby-lang.org/issues/10685 prevents - # default_headers from being a keyword argument. - def initialize(status = 200, header = {}, body = [], default_headers = self.class.default_headers) + def initialize(status = 200, header = {}, body = [], default_headers: self.class.default_headers) super() header = merge_default_headers(header, default_headers) diff --git a/actionpack/lib/action_dispatch/testing/test_response.rb b/actionpack/lib/action_dispatch/testing/test_response.rb index 527784885c..a9b88ac5fd 100644 --- a/actionpack/lib/action_dispatch/testing/test_response.rb +++ b/actionpack/lib/action_dispatch/testing/test_response.rb @@ -7,7 +7,7 @@ module ActionDispatch # See Response for more information on controller response objects. class TestResponse < Response def self.from_response(response) - new response.status, response.headers, response.body, nil + new response.status, response.headers, response.body, default_headers: nil end # Was the response successful? -- cgit v1.2.3