diff options
author | bptato <nincsnevem662@gmail.com> | 2023-09-08 10:52:07 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-09-08 10:52:07 +0200 |
commit | 396d1364c541685a014bc2e0fed1eae7130e1731 (patch) | |
tree | 1553dc9410715aa9994595b9174718e0893a1958 /src/types | |
parent | 881cc4e3216478468d2fb630ca7d76b9ba40872a (diff) | |
download | chawan-396d1364c541685a014bc2e0fed1eae7130e1731.tar.gz |
URL: fix missing searchParams when baseURL is given
The base.isSome branch was missing the searchParams initialization.
Diffstat (limited to 'src/types')
-rw-r--r-- | src/types/url.nim | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/types/url.nim b/src/types/url.nim index c472e709..ddacaa38 100644 --- a/src/types/url.nim +++ b/src/types/url.nim @@ -977,6 +977,9 @@ proc newURL*(s: string, base: Option[string] = none(string)): let url = parseURL(s, baseURL) if url.isNone: return err(newTypeError(s & " is not a valid URL")) + url.get.searchParams = newURLSearchParams() + url.get.searchParams.url = url + url.get.searchParams.initURLSearchParams(url.get.query.get("")) return ok(url.get) let url = parseURL(s) if url.isNone: |