about summary refs log tree commit diff stats
path: root/src/types
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2022-08-02 23:33:28 +0200
committerbptato <nincsnevem662@gmail.com>2022-08-02 23:33:53 +0200
commitec26d22cedb03fd8a03c110fad6b6a91c444329b (patch)
treea062b2995707379f2be6a92a3b8dcc6bc5fa7ff6 /src/types
parent7de898bd05fd54f216009ebc3775a007fd92c417 (diff)
downloadchawan-ec26d22cedb03fd8a03c110fad6b6a91c444329b.tar.gz
Fix non-special url scheme parsing
Diffstat (limited to 'src/types')
-rw-r--r--src/types/url.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/types/url.nim b/src/types/url.nim
index 7f41025b..fd1aa201 100644
--- a/src/types/url.nim
+++ b/src/types/url.nim
@@ -389,6 +389,7 @@ proc basicParseUrl*(input: string, base = none(Url), url: var Url = Url(), overr
           state = SPECIAL_AUTHORITY_SLASHES_STATE
         elif has(1) and c(1) == '/':
           state = PATH_OR_AUTHORITY_STATE
+          inc pointer
         else:
           url.path = EmptyPath
           state = OPAQUE_PATH_STATE
@@ -554,7 +555,7 @@ proc basicParseUrl*(input: string, base = none(Url), url: var Url = Url(), overr
             #TODO validation error
             return none(Url)
           let port = cast[uint16](i).some
-          url.port = if url.default_port == port: none(uint16) else: port
+          url.port = if url.is_special and url.default_port == port: none(uint16) else: port
           buffer = ""
         if override:
           return