From e837849d447910d1823d5b0380103ebaedac9cb1 Mon Sep 17 00:00:00 2001 From: Junoh Moon Date: Sat, 29 Apr 2023 20:07:52 +0900 Subject: [PATCH] Add charset to content type in getHandler (#545) Add charset to content type in the getHandler function to fix CJK-letter related issues. If the content type is empty after trimming, set it to "text/plain; charset=utf-8". --- server/handlers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/handlers.go b/server/handlers.go index 704a987..fb187c3 100644 --- a/server/handlers.go +++ b/server/handlers.go @@ -1218,7 +1218,7 @@ func (s *Server) getHandler(w http.ResponseWriter, r *http.Request) { So add text/plain in this case to fix XSS related issues/ */ if strings.TrimSpace(contentType) == "" { - contentType = "text/plain" + contentType = "text/plain; charset=utf-8" } } else { disposition = "attachment"