mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-09-25 19:24:38 +02:00
Rename IMGPROXY_ENABLE_*_DETECTION
configs to IMGPROXY_AUTO_*
This commit is contained in:
@@ -1081,17 +1081,17 @@ func defaultProcessingOptions(headers http.Header) (*ProcessingOptions, error) {
|
||||
headerAccept := headers.Get("Accept")
|
||||
|
||||
if strings.Contains(headerAccept, "image/webp") {
|
||||
po.PreferWebP = config.EnableWebpDetection || config.EnforceWebp
|
||||
po.PreferWebP = config.AutoWebp || config.EnforceWebp
|
||||
po.EnforceWebP = config.EnforceWebp
|
||||
}
|
||||
|
||||
if strings.Contains(headerAccept, "image/avif") {
|
||||
po.PreferAvif = config.EnableAvifDetection || config.EnforceAvif
|
||||
po.PreferAvif = config.AutoAvif || config.EnforceAvif
|
||||
po.EnforceAvif = config.EnforceAvif
|
||||
}
|
||||
|
||||
if strings.Contains(headerAccept, "image/jxl") {
|
||||
po.PreferJxl = config.EnableJxlDetection || config.EnforceJxl
|
||||
po.PreferJxl = config.AutoJxl || config.EnforceJxl
|
||||
po.EnforceJxl = config.EnforceJxl
|
||||
}
|
||||
|
||||
|
@@ -478,7 +478,7 @@ func (s *ProcessingOptionsTestSuite) TestParsePathStripMetadata() {
|
||||
}
|
||||
|
||||
func (s *ProcessingOptionsTestSuite) TestParsePathWebpDetection() {
|
||||
config.EnableWebpDetection = true
|
||||
config.AutoWebp = true
|
||||
|
||||
path := "/plain/http://images.dev/lorem/ipsum.jpg"
|
||||
headers := http.Header{"Accept": []string{"image/webp"}}
|
||||
|
Reference in New Issue
Block a user