Skip to content

Commit 2afa644

Browse files
committed
http/cookie: canonicalize domain for lookup
1 parent 50f2fdd commit 2afa644

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

http/cookie.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ local function cookie_match(cookie, req_domain, req_is_http, req_is_secure, req_
518518
end
519519

520520
function store_methods:lookup(req_domain, req_path, req_is_http, req_is_secure, req_is_safe_method, req_site_for_cookies, req_is_top_level, max_cookie_length)
521-
assert(type(req_domain) == "string")
521+
req_domain = assert(type(req_domain) == "string" and canonicalise_host(req_domain), "invalid request domain")
522522
assert(type(req_path) == "string")
523523
if max_cookie_length ~= nil then
524524
assert(type(max_cookie_length) == "number")

0 commit comments

Comments
 (0)