Skip to content

Commit

Permalink
Fix clack.middleware.csrf to be compatible to v1.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
fukamachi committed Dec 5, 2014
1 parent 9804d0b commit f56fd3e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion clack-middleware-csrf.asd
Expand Up @@ -18,7 +18,7 @@
(in-package :clack-middleware-csrf-asd)

(defsystem clack-middleware-csrf
:version "0.2.0"
:version "0.2.1"
:author "Eitaro Fukamachi"
:license "LLGPL"
:depends-on (:clack
Expand Down
4 changes: 1 addition & 3 deletions src/contrib/middleware/csrf.lisp
Expand Up @@ -66,9 +66,7 @@
(let ((req (make-request env)))
(when-let (csrf-token (gethash :csrf-token
(getf env :clack.session)))
(or (string= csrf-token (body-parameter req :|_csrf_token|))
(and (hash-table-p (body-parameter req :json))
(string= csrf-token (gethash "_csrf_token" (body-parameter req :json))))))))
(string= csrf-token (body-parameter req "_csrf_token")))))

@export
(defun csrf-token (session)
Expand Down

0 comments on commit f56fd3e

Please sign in to comment.