mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-23 10:53:34 +08:00
support file names with a comma inside.
This commit is contained in:
@@ -100,6 +100,7 @@ func DownloadUrl(fileUrl string) (filename string, content []byte, e error) {
|
|||||||
glog.V(4).Info("Content-Disposition: ", contentDisposition[0])
|
glog.V(4).Info("Content-Disposition: ", contentDisposition[0])
|
||||||
if strings.HasPrefix(contentDisposition[0], "filename=") {
|
if strings.HasPrefix(contentDisposition[0], "filename=") {
|
||||||
filename = contentDisposition[0][len("filename="):]
|
filename = contentDisposition[0][len("filename="):]
|
||||||
|
filename = strings.Trim(filename, "\"")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
glog.V(4).Info("No Content-Disposition!")
|
glog.V(4).Info("No Content-Disposition!")
|
||||||
|
@@ -111,7 +111,7 @@ func (vs *VolumeServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request,
|
|||||||
w.Header().Set("Content-Type", mtype)
|
w.Header().Set("Content-Type", mtype)
|
||||||
}
|
}
|
||||||
if filename != "" {
|
if filename != "" {
|
||||||
w.Header().Set("Content-Disposition", "filename="+fileNameEscaper.Replace(filename))
|
w.Header().Set("Content-Disposition", "filename=\""+fileNameEscaper.Replace(filename)+"\"")
|
||||||
}
|
}
|
||||||
if ext != ".gz" {
|
if ext != ".gz" {
|
||||||
if n.IsGzipped() {
|
if n.IsGzipped() {
|
||||||
|
Reference in New Issue
Block a user