Fix cookie-parsing bug in the example note-taking app (#761)

This commit is contained in:
Joey Bloom 2021-03-26 16:07:52 -05:00 committed by GitHub
parent 8936060d42
commit 1533a2d0b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -88,7 +88,7 @@
(defn get-session-id [headers]
(if-let [cookie-header (first (filter #(str/starts-with? % "Cookie: ") headers))]
(let [parts (str/split cookie-header #"; ")]
(let [parts (str/split (str/replace cookie-header "Cookie: " "") #"; ")]
(if-let [notes-id (first (filter #(str/starts-with? % "notes-id") parts))]
(str/replace notes-id "notes-id=" "")
(new-session!)))