[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:
parent
886a4e4637
commit
dad05aa832
5
morty.go
5
morty.go
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user