Skip to content

Commit 52869c8

Browse files
authored
Merge pull request #140 from MindscapeHQ/tl/fix-139
Fixes #139
2 parents b88d39a + dcc1c31 commit 52869c8

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 3.1.1 (16/01/2019):
2+
Bugfix:
3+
- Don't attempt to modify response unless JS api key is present
4+
- Don't attempt to modify response unless it responds to indexing ([])
5+
- See PR ([#140](https://github.com/MindscapeHQ/raygun4ruby/pull/140))
6+
17
## 3.1.0 (15/01/2019):
28

39
Feature:

lib/raygun/middleware/javascript_exception_tracking.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ def call(env)
1616
end
1717

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

2224
response
2325
end

lib/raygun/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module Raygun
2-
VERSION = "3.1.0"
2+
VERSION = "3.1.1"
33
end

0 commit comments

Comments
 (0)