If no favicon is found then break out and send an internal reverse proxy request

This commit is contained in:
Melon 2023-06-20 17:36:54 +01:00
parent a63dd95201
commit ba1c0d4129
Signed by: melon
GPG Key ID: 6C9D970C50D26A25

View File

@ -72,6 +72,9 @@ func setupFaviconMiddleware(fav *favicons.Favicons, next http.Handler) http.Hand
switch req.URL.Path {
case "/favicon.svg", "/favicon.png", "/favicon.ico":
icons := fav.GetIcons(req.Host)
if icons == nil {
break
}
raw, contentType, err := icons.ProduceForExt(path.Ext(req.URL.Path))
if err != nil {
utils.RespondVioletError(rw, http.StatusTeapot, "No icon available")