aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/types/url.nim2
-rw-r--r--src/utils/twtstr.nim1
2 files changed, 2 insertions, 1 deletions
diff --git a/src/types/url.nim b/src/types/url.nim
index 75d6e050..10b91fe5 100644
--- a/src/types/url.nim
+++ b/src/types/url.nim
@@ -381,7 +381,7 @@ proc basicParseUrl*(input: string, base = none(Url), url: Url = Url(), stateOver
#TODO validation error
return none(Url)
of SCHEME_STATE:
- if has and c in AsciiAlpha + {'+', '-', '.'}:
+ if has and c in AsciiAlphaNumeric + {'+', '-', '.'}:
buffer &= c.tolower()
elif has and c == ':':
if override:
diff --git a/src/utils/twtstr.nim b/src/utils/twtstr.nim
index aea8bea5..027b26d1 100644
--- a/src/utils/twtstr.nim
+++ b/src/utils/twtstr.nim
@@ -23,6 +23,7 @@ const AsciiLowerAlpha* = {'a'..'z'}
const AsciiAlpha* = (AsciiUpperAlpha + AsciiLowerAlpha)
const NonAscii* = (AllChars - Ascii)
const AsciiDigit* = {'0'..'9'}
+const AsciiAlphaNumeric* = AsciiAlpha + AsciiDigit
const AsciiHexDigit* = (AsciiDigit + {'a'..'f', 'A'..'F'})
const AsciiWhitespace* = {' ', '\n', '\r', '\t', '\f'}