Pārlūkot izejas kodu

Escape quotes in content disposition

DarthSim 3 gadi atpakaļ
vecāks
revīzija
2ae2a539fe
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      imagetype/imagetype.go

+ 1 - 1
imagetype/imagetype.go

@@ -99,7 +99,7 @@ func (it Type) ContentDisposition(filename string) string {
 		return "inline"
 	}
 
-	return fmt.Sprintf(format, filename)
+	return fmt.Sprintf(format, strings.ReplaceAll(filename, `"`, "%22"))
 }
 
 func (it Type) ContentDispositionFromURL(imageURL string) string {