about summary refs log tree commit diff stats
path: root/src/types
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2022-12-13 11:38:54 +0100
committerbptato <nincsnevem662@gmail.com>2022-12-13 11:38:54 +0100
commitf3e2cb7bfa4517155a2c6675e6310f17d8ca4d89 (patch)
treeae87e244143d3c0c3cb434ea49f91a3a810a9acc /src/types
parentd4ec11f65d4748167c55a526eacfa63725a7c0a8 (diff)
downloadchawan-f3e2cb7bfa4517155a2c6675e6310f17d8ca4d89.tar.gz
cookie: check for domain
Diffstat (limited to 'src/types')
-rw-r--r--src/types/cookie.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/types/cookie.nim b/src/types/cookie.nim
index 807c494f..db5a4de3 100644
--- a/src/types/cookie.nim
+++ b/src/types/cookie.nim
@@ -113,7 +113,7 @@ proc `$`*(cookiejar: CookieJar): string =
     let cookie = cookiejar.cookies[i]
     if cookie.expires <= t:
       cookiejar.cookies.delete(i)
-    else:
+    elif cookie.domain == "" or cookiejar.location.host.endsWith(cookie.domain):
       result.percentEncode(cookie.name, UserInfoPercentEncodeSet)
       result &= "="
       result.percentEncode(cookie.value, UserInfoPercentEncodeSet)