#2282 fix utf-8 recognized as windows-1252

This commit is contained in:
Unknwon 2015-12-25 05:25:47 -05:00
parent 13fe733037
commit 85af36332b
6 changed files with 13 additions and 10 deletions

View file

@ -6,6 +6,7 @@ package user
import (
"fmt"
"path"
"strings"
"github.com/gogits/gogs/models"
@ -38,7 +39,7 @@ func Profile(ctx *middleware.Context) {
uname := ctx.Params(":username")
// Special handle for FireFox requests favicon.ico.
if uname == "favicon.ico" {
ctx.Redirect(setting.AppSubUrl + "/img/favicon.png")
ctx.ServeFile(path.Join(setting.StaticRootPath, "public/img/favicon.png"))
return
} else if strings.HasSuffix(uname, ".png") {
ctx.Error(404)