use avatar proxy instead of directly serving from GH

This commit is contained in:
Arya Kiran
2023-02-10 16:01:57 +05:30
parent 4e57c47eb0
commit 4319d9d835
+2
View File
@@ -172,6 +172,8 @@ func HandleUser(c *fiber.Ctx) error {
log.Println("Bio and Location routes cannot be scraped for organizations")
}
sc.Visit("https://github.com/" + c.Params("user") + "/")
Scrape.AvatarUrl = strings.TrimPrefix(Scrape.AvatarUrl, "https://avatars.githubusercontent.com/u/")
Scrape.AvatarUrl = "/avatar/" + Scrape.AvatarUrl
userArray = append(userArray, Scrape)
return c.Render("user", fiber.Map{