logjam_agent 0.17.1 → 0.18.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/logjam_agent/middleware.rb +9 -0
- data/lib/logjam_agent/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 375304657bb752c670704f325f55054bf811d9c5
|
4
|
+
data.tar.gz: 09ab3cf2c0037d3c2f0986d9d926b342f543e7ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc70919214e1d998562108257dbb824235c71fc8a0e90c914207968cac7559f07f250205fa081757201639a8192fd4a44041b940cade6b29b1d71c857de66db4
|
7
|
+
data.tar.gz: f952178602f923e69cd98a9963e9a95bd4e01ed1575b520a60e0bad92e68ba97e5b3418421e171f601c1844c9dca71fde22a6cd3955e5a9fad39c1329513ba06
|
@@ -15,6 +15,11 @@ module LogjamAgent
|
|
15
15
|
ensure
|
16
16
|
headers = result[1]
|
17
17
|
headers["X-Logjam-Request-Id"] = request.id
|
18
|
+
# this cookie is intended for JS code, which can't read it from response headers.
|
19
|
+
# it's superior to returning it with the html body, because that makes caching hard.
|
20
|
+
if set_request_id_cookie?(request, env)
|
21
|
+
::Rack::Utils.set_cookie_header!(headers, "X-Logjam-Request-Id", {:value => request.id, :path => "/"})
|
22
|
+
end
|
18
23
|
unless (request_action = request.fields[:action]).blank?
|
19
24
|
headers["X-Logjam-Request-Action"] = request_action
|
20
25
|
end
|
@@ -37,5 +42,9 @@ module LogjamAgent
|
|
37
42
|
def finish_request(env)
|
38
43
|
LogjamAgent.finish_request(env["time_bandits.metrics"])
|
39
44
|
end
|
45
|
+
|
46
|
+
def set_request_id_cookie?(request, env)
|
47
|
+
!(request.ignored? || env["HTTP_X_REQUESTED_WITH"] == "XMLHttpRequest")
|
48
|
+
end
|
40
49
|
end
|
41
50
|
end
|
data/lib/logjam_agent/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logjam_agent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.18.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefan Kaes
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|