diff --git a/src/cookiejar/cookies.nim b/src/cookiejar/cookies.nim index 0bb0e39..4cfd696 100644 --- a/src/cookiejar/cookies.nim +++ b/src/cookiejar/cookies.nim @@ -53,8 +53,8 @@ func initCookie*( result = Cookie(name: name, value: value, expires: expires, maxAge: maxAge, domain: domain, path: path, secure: secure, httpOnly: httpOnly, sameSite: sameSite) - -func initCookie*( + +proc initCookie*( name, value: string, expires: DateTime|Time, maxAge = none(int), domain = "", path = "", secure = false, httpOnly = false, sameSite = Lax diff --git a/tests/test.nim b/tests/test.nim index 5601d60..8f87a30 100644 --- a/tests/test.nim +++ b/tests/test.nim @@ -10,7 +10,7 @@ discard """ import options import strformat import times -import cookiejar +import ../src/cookiejar # forwards can work @@ -19,6 +19,15 @@ block: discard daysForward(10) discard timesForward(1, 2, 3, 4, 5, 6, 7, 8) + +# InitCookie +block: + let + username = "admin" + password = "root" + + discard initCookie(username, password, now()) + # SetCookie block: let