Skip to content

Commit

Permalink
Merge pull request #140 from MindscapeHQ/tl/fix-139
Browse files Browse the repository at this point in the history
Fixes #139
  • Loading branch information
UberMouse authored Jan 16, 2019
2 parents b88d39a + dcc1c31 commit 52869c8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 3.1.1 (16/01/2019):
Bugfix:
- Don't attempt to modify response unless JS api key is present
- Don't attempt to modify response unless it responds to indexing ([])
- See PR ([#140](https://github.com/MindscapeHQ/raygun4ruby/pull/140))

## 3.1.0 (15/01/2019):

Feature:
Expand Down
6 changes: 4 additions & 2 deletions lib/raygun/middleware/javascript_exception_tracking.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ def call(env)
end

def inject_javascript_to_response(response)
response[0].gsub!('</head>', "#{js_tracker.head_html}</head>")
response[0].gsub!('</body>', "#{js_tracker.body_html}</body>")
if Raygun.configuration.js_api_key.present? && response.respond_to?('[]')
response[0].gsub!('</head>', "#{js_tracker.head_html}</head>")
response[0].gsub!('</body>', "#{js_tracker.body_html}</body>")
end

response
end
Expand Down
2 changes: 1 addition & 1 deletion lib/raygun/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Raygun
VERSION = "3.1.0"
VERSION = "3.1.1"
end

0 comments on commit 52869c8

Please sign in to comment.