Fix not being able to search for the letter 'f'

This commit is contained in:
2024-11-14 17:56:01 +01:00
parent 9a4d9a5d9b
commit e293c875b5
3 changed files with 20 additions and 5 deletions

View File

@@ -154,6 +154,9 @@ func (wc *WebController) serveListViewer(w http.ResponseWriter, r *http.Request,
if apiErr, ok := err.(pixelapi.Error); ok && apiErr.Status == http.StatusNotFound {
w.WriteHeader(http.StatusNotFound)
wc.templates.Run(w, r, "list_not_found", templateData)
} else if strings.HasSuffix(err.Error(), "invalid control character in URL") {
w.WriteHeader(http.StatusNotFound)
wc.templates.Run(w, r, "list_not_found", templateData)
} else {
log.Error("API request error occurred: %s", err)
w.WriteHeader(http.StatusInternalServerError)