mirror of
https://github.com/azukaar/Cosmos-Server.git
synced 2026-05-06 11:50:42 -05:00
[release] version 0.5.0-unstable18
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "cosmos-server",
|
||||
"version": "0.5.0-unstable17",
|
||||
"version": "0.5.0-unstable18",
|
||||
"description": "",
|
||||
"main": "test-server.js",
|
||||
"bugs": {
|
||||
|
||||
+9
-1
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user