Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #24 from ithayer/master

Allow http-only cookies.
  • Loading branch information...
commit 61982395f54ac282785001ee0fbfe05840b83b81 2 parents 53f48e9 + f54940b
@weavejester weavejester authored
View
2  ring-core/src/ring/middleware/cookies.clj
@@ -34,7 +34,7 @@
set-cookie-attrs
{:comment "Comment", :comment-url "CommentURL", :discard "Discard",
:domain "Domain", :max-age "Max-Age", :path "Path", :port "Port",
- :secure "Secure", :version "Version", :expires "Expires"})
+ :secure "Secure", :version "Version", :expires "Expires", :http-only "HttpOnly"})
(defn- parse-cookie-header
"Turn a HTTP Cookie header into a list of name/value pairs."
View
4 ring-core/test/ring/middleware/test/cookies.clj
@@ -50,10 +50,10 @@
(:headers resp)))))
(deftest wrap-cookies-set-extra-attrs
- (let [cookies {"a" {:value "b", :path "/", :secure true}}
+ (let [cookies {"a" {:value "b", :path "/", :secure true, :http-only true }}
handler (constantly {:cookies cookies})
resp ((wrap-cookies handler) {})]
- (is (= {"Set-Cookie" (list "a=b;Path=/;Secure")}
+ (is (= {"Set-Cookie" (list "a=b;Path=/;Secure;HttpOnly")}
(:headers resp)))))
(deftest wrap-cookies-always-assocs-map
Please sign in to comment.
Something went wrong with that request. Please try again.