Skip to content

Commit

Permalink
Allow 0 as IMGPROXY_FALLBACK_IMAGE_HTTP_CODE value
Browse files Browse the repository at this point in the history
  • Loading branch information
DarthSim committed Aug 20, 2024
1 parent 1f828b4 commit dbfe0eb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

# Fix
- Fix handling `#` symbols in `local://`, `s3://`, `gcs://`, `abs://`, and `swift://` URLs.
- Fix `IMGPROXY_FALLBACK_IMAGE_HTTP_CODE` value check. Allow `0` value.

## [3.25.0] - 2024-07-08
### Add
Expand Down
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ func Configure() error {
return fmt.Errorf("Fallback image TTL should be greater than or equal to 0, now - %d\n", TTL)
}

if FallbackImageHTTPCode < 100 || FallbackImageHTTPCode > 599 {
if FallbackImageHTTPCode != 0 && (FallbackImageHTTPCode < 100 || FallbackImageHTTPCode > 599) {
return errors.New("Fallback image HTTP code should be between 100 and 599")
}

Expand Down

0 comments on commit dbfe0eb

Please sign in to comment.