gracefully handle a non-existant anti-forgery meta tag

This commit is contained in:
Gered 2014-12-27 23:44:33 -05:00
parent f7f4635747
commit 30535a8c60

View file

@ -108,7 +108,8 @@
:on-send (get-handlers middleware :on-send)}))
(defn- get-anti-forgery-token []
(.-content (sel1 "meta[name='anti-forgery-token']")))
(if-let [tag (sel1 "meta[name='anti-forgery-token']")]
(.-content tag)))
(defn init!
"Sets up browserchannel for use, creating a handler with the specified