Update docs of cookies.parseCookies. Closes #5721.

This commit is contained in:
Dominik Picheta 2017-11-18 11:26:18 +00:00 • committed by GitHub
commit a583d686b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,6 +13,15 @@ import strtabs, times
proc parseCookies*(s: string): StringTableRef = proc parseCookies*(s: string): StringTableRef =
## parses cookies into a string table. ## 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) result = newStringTable(modeCaseInsensitive)
var i = 0 var i = 0
while true: while true: