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".
This commit is contained in:
Junoh Moon 2023-04-29 20:07:52 +09:00 committed by GitHub
parent a5dacb36a9
commit e837849d44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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"