Skip to content

Commit 8caa9a1

Browse files
committed
Fix cookies formatting (#82)
Stop url-encoding cookie path quoting cookie expire date From RFC 6265 (4.1.1 section): expires-av = "Expires=" sane-cookie-date sane-cookie-date = <rfc1123-date, defined in [RFC2616], Section 3.3.1>
1 parent ecf027a commit 8caa9a1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

http/router/response.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ local function setcookie(resp, cookie)
4141

4242
local str = utils.sprintf('%s=%s', name, utils.uri_escape(value))
4343
if cookie.path ~= nil then
44-
str = utils.sprintf('%s;path=%s', str, utils.uri_escape(cookie.path))
44+
str = utils.sprintf('%s;path=%s', str, cookie.path)
4545
end
4646
if cookie.domain ~= nil then
4747
str = utils.sprintf('%s;domain=%s', str, cookie.domain)
4848
end
4949

5050
if cookie.expires ~= nil then
51-
str = utils.sprintf('%s;expires="%s"', str, expires_str(cookie.expires))
51+
str = utils.sprintf('%s;expires=%s', str, expires_str(cookie.expires))
5252
end
5353

5454
if not resp.headers then

0 commit comments

Comments
 (0)