We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0fcdd1c commit bf7e4acCopy full SHA for bf7e4ac
ring-core/src/ring/middleware/session/cookie.clj
@@ -87,10 +87,11 @@
87
(defn- unseal
88
"Retrieve a sealed Clojure data structure from a string"
89
[key ^String string options]
90
- (let [[data mac] (.split string "--")
91
- data (codec/base64-decode data)]
92
- (if (crypto/eq? mac (hmac key data))
93
- (deserialize (decrypt key data) options))))
+ (let [[data mac] (.split string "--")]
+ (if-let [data (try (codec/base64-decode data)
+ (catch IllegalArgumentException _ nil))]
+ (if (crypto/eq? mac (hmac key data))
94
+ (deserialize (decrypt key data) options)))))
95
96
(deftype CookieStore [secret-key options]
97
SessionStore
0 commit comments