From df490eb9ba24eb2280d5aed960b4a0e3e1d96c8a Mon Sep 17 00:00:00 2001 From: Julik Tarkhanov Date: Tue, 13 Feb 2024 16:35:26 +0100 Subject: [PATCH] Fix decode_rack_response The Rack response body is _not_ an Enumerable, it just responds to #each. The method was assuming otherwise, which led to breakage when trying to use https://github.com/appsignal/appsignal-ruby/pull/1037 --- CHANGELOG.md | 4 ++++ lib/rails_twirp/testing/integration_test.rb | 2 +- lib/rails_twirp/version.rb | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 90a4d62..eb77056 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +### 0.15.0 + +* Fix decode_rack_response to be compatible with Rack response body wrappers (and conform to the Rack SPEC) + ### 0.14.0 * Adding frozen_string_literal: true to all files. diff --git a/lib/rails_twirp/testing/integration_test.rb b/lib/rails_twirp/testing/integration_test.rb index e9ca9b0..2f74f85 100644 --- a/lib/rails_twirp/testing/integration_test.rb +++ b/lib/rails_twirp/testing/integration_test.rb @@ -91,7 +91,7 @@ def request_content_type end def decode_rack_response(service, rpc, status, headers, body) - body = body.join # body is an Enumerable + body = Array.wrap(body).join # body is each-able if status === 200 output_class = service.rpcs[rpc][:output_class] diff --git a/lib/rails_twirp/version.rb b/lib/rails_twirp/version.rb index 8aad7ef..a03b429 100644 --- a/lib/rails_twirp/version.rb +++ b/lib/rails_twirp/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module RailsTwirp - VERSION = "0.14" + VERSION = "0.15" end