Add IMGPROXY_PNG_UNLIMITED and IMGPROXY_SVG_UNLIMITED configs

This commit is contained in:
DarthSim
2024-04-15 20:28:05 +03:00
parent 70db3d2235
commit c56e9e64b9
5 changed files with 24 additions and 7 deletions

View File

@@ -44,6 +44,8 @@ var (
MaxAnimationFrameResolution int
MaxSvgCheckBytes int
MaxRedirects int
PngUnlimited bool
SvgUnlimited bool
AllowSecurityOptions bool
JpegProgressive bool
@@ -235,6 +237,8 @@ func Reset() {
MaxAnimationFrameResolution = 0
MaxSvgCheckBytes = 32 * 1024
MaxRedirects = 10
PngUnlimited = false
SvgUnlimited = false
AllowSecurityOptions = false
JpegProgressive = false
@@ -433,6 +437,9 @@ func Configure() error {
configurators.Bool(&SanitizeSvg, "IMGPROXY_SANITIZE_SVG")
configurators.Bool(&AlwaysRasterizeSvg, "IMGPROXY_ALWAYS_RASTERIZE_SVG")
configurators.Bool(&PngUnlimited, "IMGPROXY_PNG_UNLIMITED")
configurators.Bool(&SvgUnlimited, "IMGPROXY_SVG_UNLIMITED")
configurators.Bool(&AllowSecurityOptions, "IMGPROXY_ALLOW_SECURITY_OPTIONS")
configurators.Bool(&JpegProgressive, "IMGPROXY_JPEG_PROGRESSIVE")