support UTF-8, show no English Text (#625)

This commit is contained in:
awkj
2026-02-26 02:13:09 +08:00
committed by GitHub
parent b097cfcbc0
commit f83018ebf2

View File

@@ -30,7 +30,7 @@ func RawFile(ctx *context.Context) error {
if file.MimeType.CanBeEmbedded() {
ctx.Response().Header().Set("Content-Type", file.MimeType.ContentType)
} else if file.MimeType.IsText() {
ctx.Response().Header().Set("Content-Type", "text/plain")
ctx.Response().Header().Set("Content-Type", "text/plain; charset=utf-8")
} else {
ctx.Response().Header().Set("Content-Type", "application/octet-stream")
}