types: change url parsing (url with no host, unescaped queries)

master
nixo 2020-10-25 10:43:49 +01:00
parent dbde2687a2
commit ebc58a133e
1 changed files with 2 additions and 2 deletions

View File

@ -52,10 +52,10 @@ end
function Request(data::String)
reg = r"""
((?P<protocol>[^:/]+)://)? # optional protocol
(?P<host>[^:/]+) # required host
(?P<host>[^:/]+)? # required host (but can be omitted in parsing like /path/ or ./path)
(:(?P<port>[0-9]{1,5}))? # optional port (will match impossible 65000+ ports)
(/(?P<path>[^\?]*))? # optional path
(\?(?P<query>[^\?]+))? # optional query
(\?(?P<query>.+))? # optional query
"""x
s = endswith(data, "\r\n") ? data[1:end-2] : data
m = match(reg, s)