diff --git a/ring-core/src/ring/middleware/cookies.clj b/ring-core/src/ring/middleware/cookies.clj index 860f5053..c082cb9a 100644 --- a/ring-core/src/ring/middleware/cookies.clj +++ b/ring-core/src/ring/middleware/cookies.clj @@ -21,7 +21,7 @@ (def ^:private set-cookie-attrs {:domain "Domain", :max-age "Max-Age", :path "Path" :secure "Secure", :expires "Expires", :http-only "HttpOnly" - :same-site "SameSite"}) + :same-site "SameSite", :partitioned "Partitioned"}) (def ^:private same-site-values {:strict "Strict", :lax "Lax", :none "None"}) diff --git a/ring-core/test/ring/middleware/test/cookies.clj b/ring-core/test/ring/middleware/test/cookies.clj index f19a3afb..4463f28e 100644 --- a/ring-core/test/ring/middleware/test/cookies.clj +++ b/ring-core/test/ring/middleware/test/cookies.clj @@ -103,6 +103,13 @@ (is (= {"Set-Cookie" (list "a=b" "c=d")} (:headers resp))))) +(deftest wrap-cookies-set-partitioned + (let [response {:cookies {"a" {:value "foo" :partitioned true}}} + handler (constantly response) + resp ((wrap-cookies handler) {})] + (is (= {"Set-Cookie" #{"a=foo" "Partitioned"}} + (split-set-cookie (:headers resp)))))) + (deftest wrap-cookies-invalid-attrs (let [response {:cookies {"a" {:value "foo" :invalid true}}} handler (wrap-cookies (constantly response))]