types: change url parsing (url with no host, unescaped queries)
parent
dbde2687a2
commit
ebc58a133e
|
@ -52,10 +52,10 @@ end
|
||||||
function Request(data::String)
|
function Request(data::String)
|
||||||
reg = r"""
|
reg = r"""
|
||||||
((?P<protocol>[^:/]+)://)? # optional protocol
|
((?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<port>[0-9]{1,5}))? # optional port (will match impossible 65000+ ports)
|
||||||
(/(?P<path>[^\?]*))? # optional path
|
(/(?P<path>[^\?]*))? # optional path
|
||||||
(\?(?P<query>[^\?]+))? # optional query
|
(\?(?P<query>.+))? # optional query
|
||||||
"""x
|
"""x
|
||||||
s = endswith(data, "\r\n") ? data[1:end-2] : data
|
s = endswith(data, "\r\n") ? data[1:end-2] : data
|
||||||
m = match(reg, s)
|
m = match(reg, s)
|
||||||
|
|
Loading…
Reference in New Issue