Permalink
Browse files

FIX: check for nil response on JsonCsrf protection

Some reaction do not return a response, think for example drop_session. In that case a nil response
would be returned, see issue #50.
  • Loading branch information...
1 parent d1f0300 commit eb7e4c9a176dcde3e5dbb269e6f9c890904d3461 @bugant bugant committed Apr 8, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/rack/protection/json_csrf.rb
@@ -19,7 +19,7 @@ def call(env)
if has_vector? request, headers
warn env, "attack prevented by #{self.class}"
- react(env)
+ react(env) or [status, headers, body]
else
[status, headers, body]
end

0 comments on commit eb7e4c9

Please sign in to comment.