logjam_agent 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/logjam_agent/rack/logger.rb +16 -16
- data/lib/logjam_agent/version.rb +1 -1
- metadata +4 -4
@@ -50,20 +50,6 @@ module LogjamAgent
|
|
50
50
|
env["time_bandits.metrics"] = TimeBandits.metrics
|
51
51
|
end
|
52
52
|
|
53
|
-
HIDDEN_VARIABLES = /\A([a-z]|SERVER|PATH|GATEWAY|REQUEST|SCRIPT|REMOTE|QUERY|PASSENGER|DOCUMENT|SCGI|UNION_STATION)/o
|
54
|
-
|
55
|
-
TRANSLATED_VARIABLES = /\A(HTTP|CONTENT_LENGTH)/
|
56
|
-
|
57
|
-
TRANSLATED_KEYS = Hash.new do |h,k|
|
58
|
-
h[k] = k.sub(/\AHTTP_/,'').split('_').map(&:capitalize).join('-') if k =~ TRANSLATED_VARIABLES
|
59
|
-
end
|
60
|
-
|
61
|
-
REFERER = 'HTTP_REFERER'
|
62
|
-
CONTENT_LENGTH = 'CONTENT_LENGTH'
|
63
|
-
|
64
|
-
KV_RE = '[^&;=]+'
|
65
|
-
PAIR_RE = %r{(#{KV_RE})=(#{KV_RE})}
|
66
|
-
|
67
53
|
def extract_request_info(request)
|
68
54
|
request_info = {}
|
69
55
|
filter = request.send(:parameter_filter)
|
@@ -88,10 +74,24 @@ module LogjamAgent
|
|
88
74
|
{}
|
89
75
|
end
|
90
76
|
|
77
|
+
HIDDEN_VARIABLES = /\A([a-z]|SERVER|PATH|GATEWAY|REQUEST|SCRIPT|REMOTE|QUERY|PASSENGER|DOCUMENT|SCGI|UNION_STATION|ORIGINAL_FULL_PATH)/o
|
78
|
+
|
79
|
+
TRANSLATED_VARIABLES = /\A(HTTP|CONTENT_LENGTH)/
|
80
|
+
|
81
|
+
TRANSLATED_KEYS = Hash.new do |h,k|
|
82
|
+
h[k] = k.sub(/\AHTTP_/,'').split('_').map(&:capitalize).join('-') if k =~ TRANSLATED_VARIABLES
|
83
|
+
end
|
84
|
+
|
85
|
+
REFERER = 'HTTP_REFERER'
|
86
|
+
CONTENT_LENGTH = 'CONTENT_LENGTH'
|
87
|
+
|
88
|
+
KV_RE = '[^&;=]+'
|
89
|
+
PAIR_RE = %r{(#{KV_RE})=(#{KV_RE})}
|
90
|
+
|
91
91
|
def extract_headers(request, filter)
|
92
|
-
headers = request.
|
93
|
-
headers.reject!{|k,v| k =~ HIDDEN_VARIABLES }
|
92
|
+
headers = request.env.reject{|k,v| k =~ HIDDEN_VARIABLES }
|
94
93
|
headers.delete(CONTENT_LENGTH) if request.content_length == 0
|
94
|
+
headers = filter.filter(headers)
|
95
95
|
|
96
96
|
if referer = headers[REFERER]
|
97
97
|
headers[REFERER] = referer.gsub(PAIR_RE) do |_|
|
data/lib/logjam_agent/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logjam_agent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 9
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 0.5.
|
9
|
+
- 1
|
10
|
+
version: 0.5.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Stefan Kaes
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-09-
|
18
|
+
date: 2012-09-18 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: rake
|