Skip to content

Commit

Permalink
Fix decode_rack_response
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 df490eb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.

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 df490eb

Please sign in to comment.