types: change url parsing (url with no host, unescaped queries)
This commit is contained in:
parent
dbde2687a2
commit
ebc58a133e
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue