mirror of
https://github.com/pocketbase/pocketbase.git
synced 2026-10-13 01:28:16 +02:00
added quotes for the default Content-Disposition serving filename in case custom name with special characters is provided
This commit is contained in:
1 parent
4c6c166603
commit
b259534df7
3 files changed
+13
-11
No files matched your search
@@ -464,7 +464,7 @@ func (s *System) Serve(res http.ResponseWriter, req *http.Request, fileKey strin
|
||||
extContentType = ct
|
||||
}
|
||||
|
||||
setHeaderIfMissing(res, "Content-Disposition", disposition+"; filename="+name)
|
||||
setHeaderIfMissing(res, "Content-Disposition", disposition+"; filename="+strconv.Quote(name))
|
||||
setHeaderIfMissing(res, "Content-Type", extContentType)
|
||||
setHeaderIfMissing(res, "Content-Security-Policy", "default-src 'none'; media-src 'self'; style-src 'unsafe-inline'; sandbox")
|
||||
|
||||
|
||||
Reference in new issue
Block a user