Skip to content

Commit a915a44

Browse files
committed
Improve session cookie key deprecation warning
Fixes #413.
1 parent aaa27d0 commit a915a44

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

ring-core/src/ring/middleware/session/cookie.clj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@
5656

5757
(defn- print-string-secret-key-deprecation []
5858
(binding [*out* *err*]
59-
(println "WARNING: The secret key for the session cookie store should be a"
60-
"byte array.\nString secret keys have been deprecated.")))
59+
(println "[ring.middleware.session.cookie] WARNING: The secret key for the"
60+
"session cookie\nstore should be a byte array. Secret keys as"
61+
"Strings have been deprecated.")))
6162

6263
(defn- get-secret-key
6364
"Get a valid secret key from a map of options, or create a random one from

ring-core/test/ring/middleware/session/test/cookie.clj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,5 +75,6 @@
7575
(is (= (with-out-str
7676
(binding [*err* *out*]
7777
(cookie-store {:key "0123456789abcdef"})))
78-
(str "WARNING: The secret key for the session cookie store should be a"
79-
" byte array.\nString secret keys have been deprecated.\n"))))
78+
(str "[ring.middleware.session.cookie] WARNING: The secret key for the "
79+
"session cookie\nstore should be a byte array. Secret keys as "
80+
"Strings have been deprecated.\n"))))

0 commit comments

Comments
 (0)