all repos — honk @ 82ac330b1482e6616421e65634b48b1270f072b5

my fork of honk

clean up
Anirudh Oppiliappan x@icyphox.sh
Tue, 08 Nov 2022 16:08:49 +0530
commit

82ac330b1482e6616421e65634b48b1270f072b5

parent

4e54b81fe1ae837f153bec55f099066c76c73bf3

1 files changed, 9 insertions(+), 0 deletions(-)

jump to
M web.goweb.go

@@ -2128,12 +2128,19 @@ j, err := GetJunkFast(uinfo.UserID, n)

if err != nil { dlog.Println("avatating: getting junk:", err) a = avatateautogen(r) + goto nope } pfpurl, _ := j.GetString("icon", "url") res, err := http.Get(pfpurl) + if res.StatusCode != 200 { + dlog.Printf("avatating: %n: not ok: %s", n, res.StatusCode) + a = avatateautogen(r) + goto nope + } if err != nil { dlog.Println("avatating: getting pfp url:", err) a = avatateautogen(r) + goto nope } defer res.Body.Close()

@@ -2141,12 +2148,14 @@ pfpbytes, err := io.ReadAll(res.Body)

if err != nil { dlog.Println("avatating: bruh shits clapped:", err) a = avatateautogen(r) + goto nope } a = pfpbytes } else { a = avatateautogen(r) } +nope: if !develMode { w.Header().Set("Cache-Control", "max-age="+somedays()) }