Skip to content

Commit

Permalink
Case insensitive request method checking for csrf token
Browse files Browse the repository at this point in the history
  • Loading branch information
swlkr committed May 1, 2020
1 parent fdb194a commit 3c44891
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/joy/csrf.janet
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
(import cipher)
(import codec :as base64)
(import ./helper :prefix "")


(defn- xor-byte-strings [str1 str2]
Expand Down Expand Up @@ -45,8 +46,7 @@
(let [session-token (session-token request)
masked-token (mask-token session-token)
request (put request :masked-token masked-token)]
(if (or (= "GET" (request :method))
(= "HEAD" (request :method)))
(if (or (get? request) (head? request))
(when-let [response (handler request)]
(put response :csrf-token session-token))

Expand Down

0 comments on commit 3c44891

Please sign in to comment.