[enh] do not serve javascript files

git-svn-id: file:///srv/svn/repo/yukari/trunk@17 f3bd38d9-da89-464d-a02a-eb04e43141b5
This commit is contained in:
asciimoo 2016-10-29 00:26:36 +00:00
parent 886a4e4637
commit dad05aa832

View File

@ -210,6 +210,11 @@ func (p *Proxy) RequestHandler(ctx *fasthttp.RequestCtx) {
return
}
if bytes.Contains(bytes.ToLower(contentType), []byte("javascript")) {
p.serveMainPage(ctx, errors.New("forbidden content type"))
return
}
contentInfo := bytes.SplitN(contentType, []byte(";"), 2)
var responseBody []byte