IMG-13: http.Header, *ImageData -> ImageData (#1473)

* ImageData.Headers()

* *ImageData -> ImageData

* withmatt -> httpheaders of our own

* .Clone() headers, nil

* NewFromBytesWithFormat -> nil

* svg.go -> do not Clone()
This commit is contained in:
Victor Sokolov
2025-08-01 15:44:21 +02:00
committed by GitHub
parent e40851e460
commit 3d14c85de3
39 changed files with 356 additions and 258 deletions

View File

@@ -113,10 +113,7 @@ func streamOriginImage(ctx context.Context, reqID string, r *http.Request, rw ht
rw.Header().Set("Content-Disposition", imagetype.ContentDisposition(filename, ext, po.ReturnAttachment))
}
setCacheControl(rw, po.Expires, map[string]string{
"Cache-Control": res.Header.Get("Cache-Control"),
"Expires": res.Header.Get("Expires"),
})
setCacheControl(rw, po.Expires, res.Header)
setCanonical(rw, imageURL)
rw.Header().Set("Content-Security-Policy", "script-src 'none'")