aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJiale Zhi <vipcalio@gmail.com>2014-07-16 16:44:00 -0700
committerJiale Zhi <vipcalio@gmail.com>2014-07-16 16:44:00 -0700
commit906de6fdb5025b6481926b9066151fd399c9870c (patch)
tree880f25af8e75fa0e1181da143f8cb6f0e2c4fc2f /t
parent15f37bfd0362ec710cc3515043c05ecdc47927af (diff)
downloadlua-resty-cookie-906de6fdb5025b6481926b9066151fd399c9870c.tar.gz
lua-resty-cookie-906de6fdb5025b6481926b9066151fd399c9870c.tar.bz2
lua-resty-cookie-906de6fdb5025b6481926b9066151fd399c9870c.zip
Fix setting multiple cookies bug
Diffstat (limited to 't')
-rw-r--r--t/sanity.t16
1 files changed, 13 insertions, 3 deletions
diff --git a/t/sanity.t b/t/sanity.t
index 0899a82..1385ebb 100644
--- a/t/sanity.t
+++ b/t/sanity.t
@@ -235,6 +235,15 @@ Set cookie
ngx.log(ngx.ERR, err)
return
end
+
+ local ok, err = cookie:set({
+ key = "ID", value = "0xf7898",
+ expires = "Wed, 09 Jun 2021 10:18:14 GMT"
+ })
+ if not ok then
+ ngx.log(ngx.ERR, err)
+ return
+ end
ngx.say("Set cookie")
';
}
@@ -242,8 +251,9 @@ Set cookie
GET /t
--- no_error_log
[error]
---- response_headers
-Set-Cookie: Name=Bob; Path=/
-Set-Cookie: Age=20
+--- comment
+because "--- response_headers" does not work with multiple headers with the same
+key, so use "--- raw_response_headers_like" instead
+--- raw_response_headers_like: Set-Cookie: Name=Bob; Path=/\r\nSet-Cookie: Age=20\r\nSet-Cookie: ID=0xf7898; Expires=Wed, 09 Jun 2021 10:18:14 GMT
--- response_body
Set cookie