[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", "name": "cosmos-server",
"version": "0.5.0-unstable17", "version": "0.5.0-unstable18",
"description": "", "description": "",
"main": "test-server.js", "main": "test-server.js",
"bugs": { "bugs": {

View file

@ -63,7 +63,6 @@ func GetFavicon(w http.ResponseWriter, req *http.Request) {
return return
} }
if(req.Method == "GET") { if(req.Method == "GET") {
utils.Log("Fetch favicon for " + siteurl) utils.Log("Fetch favicon for " + siteurl)
@ -75,6 +74,15 @@ func GetFavicon(w http.ResponseWriter, req *http.Request) {
return 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) icons, err := favicon.Find(siteurl)
utils.Debug("Found Favicon: " + strconv.Itoa(len(icons))) utils.Debug("Found Favicon: " + strconv.Itoa(len(icons)))
if err != nil { if err != nil {