Skip to content

Commit

Permalink
real 0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ringabout committed Oct 2, 2020
1 parent 7fe6d71 commit aa96ca8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/cookiejar/cookies.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 10 additions & 1 deletion tests/test.nim
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ discard """
import options
import strformat
import times
import cookiejar
import ../src/cookiejar


# forwards can work
Expand All @@ -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
Expand Down

0 comments on commit aa96ca8

Please sign in to comment.