Skip to content

Commit f92d67c

Browse files
committed
http/cookie: Clean in :get to avoid returning expired cookies
1 parent 78e84bc commit f92d67c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

http/cookie.lua

+4
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,10 @@ function store_methods:get(domain, path, name)
448448
assert(type(domain) == "string")
449449
assert(type(path) == "string")
450450
assert(type(name) == "string")
451+
452+
-- Clean now so that we can assume there are no expired cookies in store
453+
self:clean()
454+
451455
local domain_cookies = self.domains[domain]
452456
if domain_cookies then
453457
local path_cookies = domain_cookies[path]

0 commit comments

Comments
 (0)