summaryrefslogtreecommitdiff
path: root/std/http/cookie_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'std/http/cookie_test.ts')
-rw-r--r--std/http/cookie_test.ts23
1 files changed, 23 insertions, 0 deletions
diff --git a/std/http/cookie_test.ts b/std/http/cookie_test.ts
index 0f42a9381..bc45b2996 100644
--- a/std/http/cookie_test.ts
+++ b/std/http/cookie_test.ts
@@ -66,6 +66,29 @@ Deno.test({
});
Deno.test({
+ name: "Cookie Path Validation",
+ fn(): void {
+ const res: Response = {};
+ const path = "/;domain=sub.domain.com";
+ res.headers = new Headers();
+ assertThrows(
+ (): void => {
+ setCookie(res, {
+ name: "Space",
+ value: "Cat",
+ httpOnly: true,
+ secure: true,
+ path,
+ maxAge: 3,
+ });
+ },
+ Error,
+ path + ": Invalid cookie path char ';'",
+ );
+ },
+});
+
+Deno.test({
name: "Cookie Delete",
fn(): void {
const res: Response = {};