summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorDominik Picheta <dominikpicheta@googlemail.com>2017-11-18 11:26:18 +0000
committerGitHub <noreply@github.com>2017-11-18 11:26:18 +0000
commita583d686b46b25747fd7b946bb7debf10bde0055 (patch)
treec8aaff0221364389964d64f005729dae754106f0 /lib
parent8443e3f6bee2596b042fcb991d70496efa45d9dc (diff)
downloadNim-a583d686b46b25747fd7b946bb7debf10bde0055.tar.gz
Update docs of cookies.parseCookies. Closes #5721.
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/cookies.nim9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/pure/cookies.nim b/lib/pure/cookies.nim
index 7d850798c..07b37c7d4 100644
--- a/lib/pure/cookies.nim
+++ b/lib/pure/cookies.nim
@@ -13,6 +13,15 @@ import strtabs, times
 
 proc parseCookies*(s: string): StringTableRef =
   ## parses cookies into a string table.
+  ##
+  ## The proc is meant to parse the Cookie header set by a client, not the
+  ## "Set-Cookie" header set by servers.
+  ##
+  ## Example:
+  ##
+  ## .. code-block::Nim
+  ##     doAssert parseCookies("a=1; foo=bar") == {"a": 1, "foo": "bar"}.newStringTable
+
   result = newStringTable(modeCaseInsensitive)
   var i = 0
   while true: