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

Fix undefined variable name in rollbar.js middleware #537

Merged
merged 1 commit into from
Oct 6, 2016
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
13 changes: 7 additions & 6 deletions lib/rollbar/middleware/js.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@ def initialize(app, config)
end

def call(env)
result = app.call(env)
app_result = app.call(env)

begin
return result unless add_js?(env, result[0], result[1])
return app_result unless add_js?(env, app_result[0], app_result[1])

response_string = add_js(env, result[2])
build_response(env, result, response_string)
response_string = add_js(env, app_result[2])
build_response(env, app_result, response_string)
rescue => e
Rollbar.log_error("[Rollbar] Rollbar.js could not be added because #{e} exception")
result

app_result
end
end

Expand Down Expand Up @@ -69,7 +70,7 @@ def add_js(env, response)
end

def build_response(env, app_result, response_string)
return result unless response_string
return app_result unless response_string

env[JS_IS_INJECTED_KEY] = true
response = ::Rack::Response.new(response_string, app_result[0],
Expand Down