Merge pull request #37 from dalf/url_fragment

[fix] URI fragment are not encoded in the mortyurl

git-svn-id: file:///srv/svn/repo/yukari/trunk@52 f3bd38d9-da89-464d-a02a-eb04e43141b5
This commit is contained in:
asciimoo 2016-11-29 12:30:07 +00:00
parent b45f6c0afe
commit 46c188539b

View File

@ -284,7 +284,11 @@ func (p *Proxy) RequestHandler(ctx *fasthttp.RequestCtx) {
responseBody = resp.Body()
}
if bytes.Contains(contentType, []byte("xhtml")) {
ctx.SetContentType("text/html; charset=UTF-8")
} else {
ctx.SetContentType(fmt.Sprintf("%s; charset=UTF-8", contentInfo[0]))
}
switch {
case bytes.Contains(contentType, []byte("css")):