Add IMGPROXY_MAX_RESULT_DIMENSION config and max_result_dimension processing option

This commit is contained in:
DarthSim
2025-06-06 19:28:41 +03:00
parent 810cad5d26
commit a5a587eb39
6 changed files with 502 additions and 0 deletions

View File

@@ -47,6 +47,7 @@ var (
MaxRedirects int
PngUnlimited bool
SvgUnlimited bool
MaxResultDimension int
AllowSecurityOptions bool
JpegProgressive bool
@@ -252,6 +253,7 @@ func Reset() {
MaxRedirects = 10
PngUnlimited = false
SvgUnlimited = false
MaxResultDimension = 0
AllowSecurityOptions = false
JpegProgressive = false
@@ -483,6 +485,8 @@ func Configure() error {
configurators.Bool(&PngUnlimited, "IMGPROXY_PNG_UNLIMITED")
configurators.Bool(&SvgUnlimited, "IMGPROXY_SVG_UNLIMITED")
configurators.Int(&MaxResultDimension, "IMGPROXY_MAX_RESULT_DIMENSION")
configurators.Bool(&AllowSecurityOptions, "IMGPROXY_ALLOW_SECURITY_OPTIONS")
configurators.Bool(&JpegProgressive, "IMGPROXY_JPEG_PROGRESSIVE")