Merge pull request #38 from dalf/uri

[enh] ignore all special characters in the URI protocol

git-svn-id: file:///srv/svn/repo/yukari/trunk@62 f3bd38d9-da89-464d-a02a-eb04e43141b5
This commit is contained in:
asciimoo 2016-12-07 11:09:30 +00:00
parent 809239ddc1
commit 781a5a6588

View File

@ -208,7 +208,7 @@ func (p *Proxy) RequestHandler(ctx *fasthttp.RequestCtx) {
log.Println("getting", requestURIStr)
req.SetRequestURI(requestURIStr)
req.Header.SetUserAgentBytes([]byte("Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36"))
req.Header.SetUserAgentBytes([]byte("Mozilla/5.0 (Windows NT 10.0; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0"))
resp := fasthttp.AcquireResponse()
defer fasthttp.ReleaseResponse(resp)
@ -500,7 +500,10 @@ func sanitizeHTML(rc *RequestConfig, out io.Writer, htmlDoc []byte) {
sanitizeHTML(rc, out, decoder.Raw())
}
case html.DoctypeToken, html.CommentToken:
case html.CommentToken:
// ignore comment. TODO : parse IE conditional comment
case html.DoctypeToken:
out.Write(decoder.Raw())
}
} else {