[fix] avoid fasthttp panic on .onion urls - see https://github.com/valyala/fasthttp/issues/196
git-svn-id: file:///srv/svn/repo/yukari/trunk@18 f3bd38d9-da89-464d-a02a-eb04e43141b5
This commit is contained in:
parent
dad05aa832
commit
1419bf2e85
5
morty.go
5
morty.go
@ -147,6 +147,11 @@ func (p *Proxy) RequestHandler(ctx *fasthttp.RequestCtx) {
|
||||
|
||||
parsedURI, err := url.Parse(string(requestURI))
|
||||
|
||||
if strings.HasSuffix(parsedURI.Host, ".onion") {
|
||||
p.serveMainPage(ctx, errors.New("Tor urls are not supported yet"))
|
||||
return
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
p.serveMainPage(ctx, err)
|
||||
return
|
||||
|
Loading…
x
Reference in New Issue
Block a user