mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-10-10 20:22:31 +02:00
Borrow buffer from imagedata pool when sanitizing SVG
This commit is contained in:
@@ -344,17 +344,14 @@ func handleProcessing(reqID string, rw http.ResponseWriter, r *http.Request) {
|
||||
// Don't process SVG
|
||||
if originData.Type == imagetype.SVG {
|
||||
if config.SanitizeSvg {
|
||||
sanitized, svgErr := svg.Satitize(originData.Data)
|
||||
sanitized, svgErr := svg.Satitize(originData)
|
||||
checkErr(ctx, "svg_processing", svgErr)
|
||||
|
||||
// Since we'll replace origin data, it's better to close it to return
|
||||
// it's buffer to the pool
|
||||
originData.Close()
|
||||
|
||||
originData = &imagedata.ImageData{
|
||||
Data: sanitized,
|
||||
Type: imagetype.SVG,
|
||||
}
|
||||
originData = sanitized
|
||||
}
|
||||
|
||||
respondWithImage(reqID, r, rw, statusCode, originData, po, imageURL, originData)
|
||||
|
Reference in New Issue
Block a user