Skip to content

Commit 1206ba5

Browse files
committed
spec/cookie_spec: Add test for attempting to overwrite HttpOnly cookie
1 parent b4460a2 commit 1206ba5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

spec/cookie_spec.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@ describe("cookie module", function()
160160
assert.truthy(s:store("example.com", "/", true, true, nil, http_cookie.parse_setcookie("foo=bar; HttpOnly")))
161161
assert.same("", s:lookup("example.com", "/", false, true))
162162
assert.same("foo=bar", s:lookup("example.com", "/", true, true))
163+
-- Now try and overwrite it with non-http :store
164+
assert.falsy(s:store("example.com", "/", false, true, nil, http_cookie.parse_setcookie("foo=bar")))
163165
end)
164166
it("supports Secure attribute", function()
165167
local s = http_cookie.new_store()

0 commit comments

Comments
 (0)