about summary refs log tree commit diff stats
path: root/src/buffer/buffer.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-06-25 10:54:25 +0200
committerbptato <nincsnevem662@gmail.com>2023-06-25 10:54:43 +0200
commitfd837c155acca689839c5ce184fd5059caa83770 (patch)
tree1a6e42620a1a625ffad91f250f6d4782b2e83e26 /src/buffer/buffer.nim
parent0461bbf6157fa4cfbc2c8054dc2c91d3593cad55 (diff)
downloadchawan-fd837c155acca689839c5ce184fd5059caa83770.tar.gz
cookie: return error on invalid domain
Diffstat (limited to 'src/buffer/buffer.nim')
-rw-r--r--src/buffer/buffer.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/buffer/buffer.nim b/src/buffer/buffer.nim
index 10345298..ae187824 100644
--- a/src/buffer/buffer.nim
+++ b/src/buffer/buffer.nim
@@ -670,8 +670,8 @@ proc setupSource(buffer: Buffer): ConnectResult =
     if "Set-Cookie" in response.headers.table:
       for s in response.headers.table["Set-Cookie"]:
         let cookie = newCookie(s, response.url)
-        if cookie != nil:
-          result.cookies.add(cookie)
+        if cookie.isOk:
+          result.cookies.add(cookie.get)
     if "Referrer-Policy" in response.headers.table:
       result.referrerpolicy = getReferrerPolicy(response.headers.table["Referrer-Policy"][0])
   buffer.istream = newTeeStream(buffer.istream, buffer.sstream, closedest = false)