Skip to content

Commit

Permalink
implement form token protection
Browse files Browse the repository at this point in the history
that was easy
  • Loading branch information
rkh committed Jun 20, 2011
1 parent 8cb2638 commit 353cd7d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/rack/protection/form_token.rb
Expand Up @@ -14,9 +14,10 @@ module Protection
# since it might be a security issue, depending on your application
#
# Compatible with Rails and rack-csrf.
#
# Not Yet Implemented!
class FormToken < AuthenticityToken
def accepts?(env)
env["HTTP_X_REQUESTED_WITH"] == "XMLHttpRequest" or super
end
end
end
end

0 comments on commit 353cd7d

Please sign in to comment.