Browse Source

Escape quotes in content disposition

DarthSim 3 years ago
parent
commit
2ae2a539fe
1 changed files with 1 additions and 1 deletions
  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 {