Skip to content

Commit 388cfd3

Browse files
committed
Update routers/common/repo.go
1 parent 50b1ec6 commit 388cfd3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

routers/common/repo.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ func ServeData(ctx *context.Context, filePath string, size int64, reader io.Read
107107
ctx.Resp.Header().Set("Content-Security-Policy", "default-src 'none'; style-src 'unsafe-inline'")
108108
}
109109

110+
// encode filename per https://datatracker.ietf.org/doc/html/rfc5987
110111
ctx.Resp.Header().Set("Content-Disposition", `inline; filename*=UTF-8''`+url.PathEscape(fileName))
111112
ctx.Resp.Header().Set("Access-Control-Expose-Headers", "Content-Disposition")
112113

0 commit comments

Comments
 (0)