mirror of
https://github.com/thomiceli/opengist.git
synced 2025-07-09 01:18:04 +02:00
Fix garbled/mojibake text display issues for non-English Unicode characters in browsers. (#441)
* Update util.go Fix garbled/mojibake text display issues for non-English Unicode characters in browsers. * add Content-Disposition, help handle file name on download Author: awkj <hzzbiu@gmail.com>
This commit is contained in:
@ -21,7 +21,9 @@ func RawFile(ctx *context.Context) error {
|
||||
return ctx.NotFound("File not found")
|
||||
}
|
||||
contentType := handlers.GetContentTypeFromFilename(file.Filename)
|
||||
ContentDisposition := handlers.GetContentDisposition(file.Filename)
|
||||
ctx.Response().Header().Set("Content-Type", contentType)
|
||||
ctx.Response().Header().Set("Content-Disposition", ContentDisposition)
|
||||
return ctx.PlainText(200, file.Content)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user