The httpserver module now supports POST requests. Fix for captureBetween in the parseutils module.
This commit is contained in:
parent
c323ec0155
commit
92a7933504
2 changed files with 69 additions and 13 deletions
|
|
@ -164,10 +164,10 @@ proc parseWhile*(s: string, token: var string, validChars: set[char],
|
|||
result = i-start
|
||||
token = substr(s, start, i-1)
|
||||
|
||||
proc captureBetween*(s: string, first: char, second = '\0', i = 0): string =
|
||||
proc captureBetween*(s: string, first: char, second = '\0', start = 0): string =
|
||||
## Finds the first occurence of ``first``, then returns everything from there
|
||||
## up to ``second``(if ``second`` is '\0', then ``first`` is used).
|
||||
var i = skipUntil(s, first, i)+1
|
||||
var i = skipUntil(s, first, start)+1+start
|
||||
result = ""
|
||||
discard s.parseUntil(result, if second == '\0': first else: second, i)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue