From 5c23c0cecd64a94c17b3a28afc3d2f9ba45b6414 Mon Sep 17 00:00:00 2001 From: med-one Date: Wed, 2 Mar 2022 11:00:04 +0800 Subject: [PATCH] fix(fix bug , add nexttime feature): ServeFileDownload filename double quotes cause underscores before and after the final file --- net/ghttp/ghttp_response.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ghttp/ghttp_response.go b/net/ghttp/ghttp_response.go index 01312f0fd..6b01be340 100644 --- a/net/ghttp/ghttp_response.go +++ b/net/ghttp/ghttp_response.go @@ -92,7 +92,7 @@ func (r *Response) ServeFileDownload(path string, name ...string) { } r.Header().Set("Content-Type", "application/force-download") r.Header().Set("Accept-Ranges", "bytes") - r.Header().Set("Content-Disposition", fmt.Sprintf(`attachment;filename="%s"`, url.QueryEscape(downloadName))) + r.Header().Set("Content-Disposition", fmt.Sprintf(`attachment;filename=%s`, url.QueryEscape(downloadName))) r.Server.serveFile(r.Request, serveFile) }