mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
http_win.do: Reject URL without '://'
Before it would accept 'domain/path' but set host = 'ath'.
This commit is contained in:
parent
7058333f17
commit
d8df8474bc
@ -27,8 +27,9 @@ fn (req &Request) do() Response {
|
|||||||
//println(req.headers)
|
//println(req.headers)
|
||||||
is_ssl := req.url.starts_with('https://')
|
is_ssl := req.url.starts_with('https://')
|
||||||
//println('is ssl=$is_ssl')
|
//println('is ssl=$is_ssl')
|
||||||
mut pos := url.index('/')
|
mut pos := url.index('://')
|
||||||
url = url.right(pos + 2)
|
if pos == -1 {return emptyresp}
|
||||||
|
url = url.right(pos + 3)
|
||||||
mut host := url
|
mut host := url
|
||||||
mut path := '/'
|
mut path := '/'
|
||||||
pos = url.index('/')
|
pos = url.index('/')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user