Skip to content

Commit

Permalink
fix: extract out wafris_request object to be used with the notifier
Browse files Browse the repository at this point in the history
  • Loading branch information
rmcastil committed Oct 23, 2024
1 parent 15f92df commit fad57ae
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/wafris/middleware.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ def initialize(app)
end

def call(env)
request = Rack::Request.new(env)

treatment = Wafris.evaluate(
WafrisRequest.new(request, env)
wafris_request = WafrisRequest.new(
Rack::Request.new(env),
env
)

treatment = Wafris.evaluate(wafris_request)

@notifier&.instrument("#{treatment}.wafris", request: wafris_request, treatment: treatment)

# These values match what the client tests expect (200, 404, 403, 500)
Expand Down

0 comments on commit fad57ae

Please sign in to comment.