about summary refs log tree commit diff stats
path: root/src/types
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2022-12-13 17:03:17 +0100
committerbptato <nincsnevem662@gmail.com>2022-12-13 17:03:17 +0100
commit4b482418c22ea31729ca94583ffd2a6aa167d811 (patch)
tree9c456555f1b3cfd45d90f28d61d7369ab96e1c5d /src/types
parent672ab553c4a2b10a703ea40e049eda52db149a93 (diff)
downloadchawan-4b482418c22ea31729ca94583ffd2a6aa167d811.tar.gz
Fix stream error handling confusion, title display
Also probably other fixes.
Diffstat (limited to 'src/types')
-rw-r--r--src/types/cookie.nim10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/types/cookie.nim b/src/types/cookie.nim
index c848813d..e5e50d3e 100644
--- a/src/types/cookie.nim
+++ b/src/types/cookie.nim
@@ -21,7 +21,7 @@ type
     path {.jsget.}: string
 
   CookieJar* = ref object
-    filter: URLFilter
+    filter*: URLFilter
     cookies*: seq[Cookie]
 
 proc parseCookieDate(val: string): Option[DateTime] =
@@ -109,6 +109,14 @@ proc parseCookieDate(val: string): Option[DateTime] =
   var dateTime = dateTime(year, Month(month), MonthdayRange(dayOfMonth), HourRange(time[0]), MinuteRange(time[1]), SecondRange(time[2]))
   return some(dateTime)
 
+# For debugging
+proc `$`*(cookiejar: CookieJar): string =
+  result &= $cookiejar.filter
+  result &= "\n"
+  for cookie in cookiejar.cookies:
+    result &= "Cookie "
+    result &= $cookie[]
+
 proc serialize*(cookiejar: CookieJar, location: URL): string =
   if not cookiejar.filter.match(location):
     return "" # fail