aboutsummaryrefslogtreecommitdiffstats
path: root/src/types
diff options
context:
space:
mode:
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