[enh] allow opening urls without protocol scheme
git-svn-id: file:///srv/svn/repo/yukari/trunk@120 f3bd38d9-da89-464d-a02a-eb04e43141b5
This commit is contained in:
parent
d56146f07f
commit
53dfdf3070
5
morty.go
5
morty.go
@ -294,6 +294,11 @@ func (p *Proxy) RequestHandler(ctx *fasthttp.RequestCtx) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if parsedURI.Scheme == "" {
|
||||||
|
parsedURI.Scheme = "https"
|
||||||
|
requestURI = append([]byte("https://"), requestURI...)
|
||||||
|
}
|
||||||
|
|
||||||
// Serve an intermediate page for protocols other than HTTP(S)
|
// Serve an intermediate page for protocols other than HTTP(S)
|
||||||
if (parsedURI.Scheme != "http" && parsedURI.Scheme != "https") || strings.HasSuffix(parsedURI.Host, ".onion") {
|
if (parsedURI.Scheme != "http" && parsedURI.Scheme != "https") || strings.HasSuffix(parsedURI.Host, ".onion") {
|
||||||
p.serveExitMortyPage(ctx, parsedURI)
|
p.serveExitMortyPage(ctx, parsedURI)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user