From 2e62cd052addf69dc825106014fb6b8e792e8d88 Mon Sep 17 00:00:00 2001 From: Anatoliy Shipticyn Date: Mon, 20 May 2019 01:30:24 +0500 Subject: [PATCH] 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 = --- http/server.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/http/server.lua b/http/server.lua index d592deb..e7dac9a 100644 --- a/http/server.lua +++ b/http/server.lua @@ -279,14 +279,14 @@ local function setcookie(resp, cookie) local str = sprintf('%s=%s', name, uri_escape(value)) if cookie.path ~= nil then - str = sprintf('%s;path=%s', str, uri_escape(cookie.path)) + str = sprintf('%s;path=%s', str, cookie.path) end if cookie.domain ~= nil then str = sprintf('%s;domain=%s', str, cookie.domain) end if cookie.expires ~= nil then - str = sprintf('%s;expires="%s"', str, expires_str(cookie.expires)) + str = sprintf('%s;expires=%s', str, expires_str(cookie.expires)) end if not resp.headers then