1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2024-11-24 08:12:38 +02:00

Fix false-positive SVG detections

This commit is contained in:
DarthSim 2022-10-28 20:15:19 +06:00
parent 8fcfe8f194
commit d07a016b66
2 changed files with 5 additions and 3 deletions

View File

@ -7,6 +7,7 @@
- (pro) Add [gradient](https://docs.imgproxy.net/latest/generating_the_url?id=gradient) processing option.
### Fix
- Fix false-positive SVG detections.
- (pro) Fix saving of GIF with variable frame delay to MP4.
## [3.9.0] - 2022-10-19

View File

@ -20,12 +20,13 @@ func IsSVG(r io.Reader) (bool, error) {
switch tt {
case xml.ErrorToken:
if err := l.Err(); err != io.EOF {
return false, err
}
return false, nil
case xml.StartTagToken:
if strings.ToLower(string(l.Text())) == "svg" {
return true, nil
}
return strings.ToLower(string(l.Text())) == "svg", nil
}
}
}