Skip to content

Instantly share code, notes, and snippets.

@spidergears
Last active December 22, 2015 01:29
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
def verified_request?
!protect_against_forgery? || request.get? || request.head? ||
form_authenticity_token == params[request_forgery_protection_token] ||
form_authenticity_token == request.headers['X-CSRF-Token']
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment