diff options
-rw-r--r-- | src/types/url.nim | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/types/url.nim b/src/types/url.nim index e95e0d21..864b62e0 100644 --- a/src/types/url.nim +++ b/src/types/url.nim @@ -327,7 +327,6 @@ proc basicParseURL*(input: string, base = none(URL), url: URL = URL(), stateOverride = none(URLState)): Option[URL] = let input = input .strip(true, false, {chr(0x00)..chr(0x1F), ' '}) - .strip(true, false, {'\t', '\n'}) var buffer = "" var atsignseen = false var insidebrackets = false @@ -357,6 +356,9 @@ proc basicParseURL*(input: string, base = none(URL), url: URL = URL(), template is_empty(path: URLPath): bool = path.ss.len == 0 while pointer <= input.len: + if pointer < input.len and input[pointer] in {'\n', '\t'}: + inc pointer + continue case state of SCHEME_START_STATE: if has and c.isAlphaAscii(): |