[fix] parse hostnames even if scheme is missing
git-svn-id: file:///srv/svn/repo/yukari/trunk@128 f3bd38d9-da89-464d-a02a-eb04e43141b5
This commit is contained in:
parent
756d8c977a
commit
640db34ff5
6
morty.go
6
morty.go
@ -321,8 +321,12 @@ func (p *Proxy) RequestHandler(ctx *fasthttp.RequestCtx) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if parsedURI.Scheme == "" {
|
if parsedURI.Scheme == "" {
|
||||||
parsedURI.Scheme = "https"
|
|
||||||
requestURI = append([]byte("https://"), requestURI...)
|
requestURI = append([]byte("https://"), requestURI...)
|
||||||
|
parsedURI, err = url.Parse(string(requestURI))
|
||||||
|
if err != nil {
|
||||||
|
p.serveMainPage(ctx, 500, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Serve an intermediate page for protocols other than HTTP(S)
|
// Serve an intermediate page for protocols other than HTTP(S)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user