beetlebugorg / mod_dims

Apache HTTP dynamic image resizing module
Other
43 stars 27 forks source link

Improve HTTP error response codes #51

Closed atarnvik closed 3 months ago

atarnvik commented 3 months ago

Improve HTTP error response codes when the request failed and serving a "no image" image

I limited changing from 500 -> 400 to cases where it's clear that the error is from a malformed URL/request. Sensitive to the fact that we don't want CDNs to cache requests forever incases where the request could work with a different client configuration.

The following errors will still result in a 500: DIMS_BAD_CLIENT, DIMS_DOWNLOAD_TIMEOUT, DIMS_IMAGEMAGICK_TIMEOUT, DIMS_HOSTNAME_NOT_IN_WHITELIST.