[release] version 0.5.0-unstable18

This commit is contained in:
Yann Stepienik 2023-05-16 19:46:03 +01:00
parent cc849b756d
commit 7352e1f61f
2 changed files with 10 additions and 2 deletions

View file

@ -1,6 +1,6 @@
{
"name": "cosmos-server",
"version": "0.5.0-unstable17",
"version": "0.5.0-unstable18",
"description": "",
"main": "test-server.js",
"bugs": {

View file

@ -63,7 +63,6 @@ func GetFavicon(w http.ResponseWriter, req *http.Request) {
return
}
if(req.Method == "GET") {
utils.Log("Fetch favicon for " + siteurl)
@ -75,6 +74,15 @@ func GetFavicon(w http.ResponseWriter, req *http.Request) {
return
}
// follow siteurl and check if any redirect. if yes, use the final url
respNew, err := http.Get(siteurl)
if err != nil {
utils.Error("FaviconFetch", err)
sendFallback(w)
return
}
siteurl = respNew.Request.URL.String()
icons, err := favicon.Find(siteurl)
utils.Debug("Found Favicon: " + strconv.Itoa(len(icons)))
if err != nil {