Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle breaking change in Rack::Response >= 2.0 #933

Merged
merged 1 commit into from
Jan 10, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lib/rollbar/middleware/js.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,12 @@ def build_response(env, app_result, response_string)
response = ::Rack::Response.new(response_string, app_result[0],
app_result[1])

response.finish
finished = response.finish

# Rack < 2.x Response#finish returns self in array[2]. Rack >= 2.x returns self.body.
# Always return with the response object here regardless of rack version.
finished[2] = response
finished
end

def build_body_with_js(env, body, head_open_end)
Expand Down