diff options
author | bptato <nincsnevem662@gmail.com> | 2023-09-30 03:35:11 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-09-30 03:36:37 +0200 |
commit | 8f20dc084112fdc605ce52adadcbb733da6ddd0f (patch) | |
tree | 8ca32feee9f800b817e34d380693004c1ee15119 /src/types | |
parent | 8048a943706ee32f5970e461dda0a01aeb55c27f (diff) | |
download | chawan-8f20dc084112fdc605ce52adadcbb733da6ddd0f.tar.gz |
buffer: improve submitForm
* add handlers for javascript, mailto * HTTP-like behavior for unknown protocols
Diffstat (limited to 'src/types')
-rw-r--r-- | src/types/url.nim | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/types/url.nim b/src/types/url.nim index 10100ee1..ac83538e 100644 --- a/src/types/url.nim +++ b/src/types/url.nim @@ -886,15 +886,15 @@ proc parseApplicationXWWWFormUrlEncoded(input: string): seq[(string, string)] = result.add((percentDecode(name), percentDecode(value))) #https://url.spec.whatwg.org/#concept-urlencoded-serializer -proc serializeApplicationXWWWFormUrlEncoded*(kvs: seq[(string, string)]): - string = +proc serializeApplicationXWWWFormUrlEncoded*(kvs: seq[(string, string)], + spaceAsPlus = true): string = for it in kvs: let (name, value) = it if result != "": result &= '&' - result.percentEncode(name, ApplicationXWWWFormUrlEncodedSet, true) + result.percentEncode(name, ApplicationXWWWFormUrlEncodedSet, spaceAsPlus) result &= '=' - result.percentEncode(value, ApplicationXWWWFormUrlEncodedSet, true) + result.percentEncode(value, ApplicationXWWWFormUrlEncodedSet, spaceAsPlus) proc initURLSearchParams(params: URLSearchParams, init: string) = params.list = parseApplicationXWWWFormUrlEncoded(init) |