wafris 2.0.5 → 2.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wafris/middleware.rb +8 -4
- data/lib/wafris/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0526847233d7c6d16c4c437e3e76027820b992e2a2973742d375b75f482d3597'
|
4
|
+
data.tar.gz: 39b2d2396ce30df2cd1705fe1b9716d1e8f39e41acd5efbc0d825da026c3e548
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6beef692dfedb3bb7d59c78467f8203e72b1dc437f6f9c72ea1f4ef91f4bbc85fbea253a84d3225a437b3094343829c14599d4cab3a3fbcc58f56bf05542237d
|
7
|
+
data.tar.gz: bcea98d516104532ac58875f408969e207e221abe3658b9c0ab07f90d6132dbb0e3145d8e17c99621c702257fd7badfbd999493f86ff73429b7640268f644494
|
data/lib/wafris/middleware.rb
CHANGED
@@ -4,16 +4,20 @@ module Wafris
|
|
4
4
|
class Middleware
|
5
5
|
def initialize(app)
|
6
6
|
@app = app
|
7
|
+
@notifier = ActiveSupport::Notifications if defined?(ActiveSupport::Notifications)
|
7
8
|
ProxyFilter.set_filter
|
8
9
|
end
|
9
10
|
|
10
11
|
def call(env)
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
WafrisRequest.new(request, env)
|
12
|
+
wafris_request = WafrisRequest.new(
|
13
|
+
Rack::Request.new(env),
|
14
|
+
env
|
15
15
|
)
|
16
16
|
|
17
|
+
treatment = Wafris.evaluate(wafris_request)
|
18
|
+
|
19
|
+
@notifier&.instrument("#{treatment}.wafris", request: wafris_request, treatment: treatment)
|
20
|
+
|
17
21
|
# These values match what the client tests expect (200, 404, 403, 500)
|
18
22
|
if treatment == "Allowed" || treatment == "Passed"
|
19
23
|
@app.call(env)
|
data/lib/wafris/version.rb
CHANGED