mirror of
https://github.com/1f349/violet.git
synced 2024-11-24 20:31:37 +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 {
|
switch req.URL.Path {
|
||||||
case "/favicon.svg", "/favicon.png", "/favicon.ico":
|
case "/favicon.svg", "/favicon.png", "/favicon.ico":
|
||||||
icons := fav.GetIcons(req.Host)
|
icons := fav.GetIcons(req.Host)
|
||||||
|
if icons == nil {
|
||||||
|
break
|
||||||
|
}
|
||||||
raw, contentType, err := icons.ProduceForExt(path.Ext(req.URL.Path))
|
raw, contentType, err := icons.ProduceForExt(path.Ext(req.URL.Path))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
utils.RespondVioletError(rw, http.StatusTeapot, "No icon available")
|
utils.RespondVioletError(rw, http.StatusTeapot, "No icon available")
|
||||||
|
Loading…
Reference in New Issue
Block a user