fixed invalid links on images when DriveCache was disabled
Some checks failed
Run Integration Tests / test (push) Failing after 21s

This commit is contained in:
partisan 2024-12-05 19:19:18 +01:00
parent b6c37452ca
commit 6c351c5f2b
4 changed files with 101 additions and 22 deletions

View file

@ -511,6 +511,8 @@ func serveMissingImage(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Cache-Control", "no-store, must-revalidate")
w.Header().Set("Pragma", "no-cache")
w.Header().Set("Expires", "0")
w.WriteHeader(http.StatusNotFound)
if config.DriveCacheEnabled {
w.WriteHeader(http.StatusNotFound)
}
http.ServeFile(w, r, missingImagePath)
}