mirror of
https://github.com/1f349/violet.git
synced 2024-11-21 10:51:40 +00:00
If no favicon is found then break out and send an internal reverse proxy request
This commit is contained in:
parent
a63dd95201
commit
ba1c0d4129
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user