Skip to content

Commit

Permalink
Fix decode_rack_response (#40)
Browse files Browse the repository at this point in the history
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 appsignal/appsignal-ruby#1037
  • Loading branch information
julik committed Feb 13, 2024
1 parent d8e8c01 commit 12ffd4f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### 0.15.0

* Exclude versions of Rails 7 which were incompatible with the pbbuilder ActionView handler, as pbbuilder cannot work there at all
* 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.

Expand Down
2 changes: 1 addition & 1 deletion lib/rails_twirp/testing/integration_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion lib/rails_twirp/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module RailsTwirp
VERSION = "0.14"
VERSION = "0.15"
end

0 comments on commit 12ffd4f

Please sign in to comment.