mirror of
https://github.com/wgh136/nysoure.git
synced 2025-12-16 15:51:14 +00:00
feat: add redirection to original image if resampled image is not available
This commit is contained in:
@@ -88,6 +88,10 @@ func handleGetResampledImage(c fiber.Ctx) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if image == nil {
|
||||
// No resampled image, redirect to original
|
||||
return c.Redirect().To("/api/image/" + idStr)
|
||||
}
|
||||
contentType := http.DetectContentType(image)
|
||||
c.Set("Content-Type", contentType)
|
||||
c.Set("Cache-Control", "public, max-age=31536000")
|
||||
|
||||
Reference in New Issue
Block a user