fix: log error if branding file exists but cannot be loaded

This commit is contained in:
Henrique Dias 2025-07-06 12:12:57 +02:00
parent cc6db83988
commit 3645b578cd
No known key found for this signature in database

View File

@ -124,7 +124,10 @@ func getStaticHandlers(store *storage.Storage, server *settings.Server, assetsFs
if d.settings.Branding.Files != "" {
if strings.HasPrefix(r.URL.Path, "img/") {
fPath := filepath.Join(d.settings.Branding.Files, r.URL.Path)
if _, err := os.Stat(fPath); err == nil {
_, err := os.Stat(fPath)
if err != nil && !os.IsNotExist(err) {
log.Printf("could not load branding file override: %v", err)
} else if err == nil {
http.ServeFile(w, r, fPath)
return 0, nil
}