diff options
Diffstat (limited to 't')
-rw-r--r-- | t/sanity.t | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -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 |