[fix] Firefox user agent instead of Chrome
Should fix #31 git-svn-id: file:///srv/svn/repo/yukari/trunk@58 f3bd38d9-da89-464d-a02a-eb04e43141b5
This commit is contained in:
parent
fd3b8ebc4c
commit
bf0abf4ce5
7
morty.go
7
morty.go
@ -207,7 +207,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)
|
||||
@ -499,10 +499,7 @@ func sanitizeHTML(rc *RequestConfig, out io.Writer, htmlDoc []byte) {
|
||||
sanitizeHTML(rc, out, decoder.Raw())
|
||||
}
|
||||
|
||||
case html.CommentToken:
|
||||
// ignore comment. TODO : parse IE conditional comment
|
||||
|
||||
case html.DoctypeToken:
|
||||
case html.DoctypeToken, html.CommentToken:
|
||||
out.Write(decoder.Raw())
|
||||
}
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user