diff --git a/lib/new_relic/rack/browser_monitoring.rb b/lib/new_relic/rack/browser_monitoring.rb index 4c68a78d3e..3b13d29a7b 100644 --- a/lib/new_relic/rack/browser_monitoring.rb +++ b/lib/new_relic/rack/browser_monitoring.rb @@ -69,17 +69,17 @@ def should_instrument?(env, status, headers) private - def autoinstrument_source(response, headers, js_to_inject) + def autoinstrument_source(response, _headers, js_to_inject) source = gather_source(response) close_old_response(response) return unless source - modify_source(source) + modify_source(source, js_to_inject) rescue => e NewRelic::Agent.logger.debug("Skipping RUM instrumentation on exception: #{e.class} - #{e.message}") end - def modify_source(source) + def modify_source(source, js_to_inject) # Only scan the first 50k (roughly) then give up. beginning_of_source = source[0..SCAN_LIMIT] meta_tag_positions = find_meta_tag_positions(beginning_of_source)