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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d1a6832a6803974c5ebc7e337c3e118fb876dececdb8154f9877411e4169baca
4
- data.tar.gz: f8c60d439b09b2b299bb17f6ab233fb265b214e72ea1791cc43d5c8a34aa2264
3
+ metadata.gz: '0526847233d7c6d16c4c437e3e76027820b992e2a2973742d375b75f482d3597'
4
+ data.tar.gz: 39b2d2396ce30df2cd1705fe1b9716d1e8f39e41acd5efbc0d825da026c3e548
5
5
  SHA512:
6
- metadata.gz: 020ff0f8179cfd43719fc7e44814fb734873f7f496e6c8a5498800643f06bb9fc1914f255cbbbb4b5b96f7a91d2fe20d6e5c9f26ed8b623684823818e9a6d970
7
- data.tar.gz: d9e6a41ea3ab39f34fbf74a81cea82846b3ad2861939c06f9ec3cb6a5f6f95e198c1af3e83c5af7ed3cffb53313398e852f163489fc4b07dc595bc5f6b4d94d3
6
+ metadata.gz: 6beef692dfedb3bb7d59c78467f8203e72b1dc437f6f9c72ea1f4ef91f4bbc85fbea253a84d3225a437b3094343829c14599d4cab3a3fbcc58f56bf05542237d
7
+ data.tar.gz: bcea98d516104532ac58875f408969e207e221abe3658b9c0ab07f90d6132dbb0e3145d8e17c99621c702257fd7badfbd999493f86ff73429b7640268f644494
@@ -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
- request = Rack::Request.new(env)
12
-
13
- treatment = Wafris.evaluate(
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)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Wafris
4
- VERSION = "2.0.5"
4
+ VERSION = "2.0.6"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wafris
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.5
4
+ version: 2.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Buckbee