all repos — honk @ 766af71e5ae27a1b84579fa15edbdab96390bcbd

my fork of honk

reroute memes to donks in emergencies
Ted Unangst tedu@tedunangst.com
Sun, 22 Oct 2023 15:07:44 -0400
commit

766af71e5ae27a1b84579fa15edbdab96390bcbd

parent

7593049d69fb25180dfe721256313037d4d414c3

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

jump to
M docs/changelog.txtdocs/changelog.txt

@@ -2,6 +2,8 @@ changelog

### next ++ Reroute memes to donks in emergencies. + + Fix handling of svg with bom fucks. + FastCGI listening.
M web.goweb.go

@@ -2423,7 +2423,13 @@ func servememe(w http.ResponseWriter, r *http.Request) {

meme := mux.Vars(r)["meme"] w.Header().Set("Cache-Control", "max-age="+somedays()) - http.ServeFile(w, r, dataDir+"/memes/"+meme) + _, err := os.Stat(dataDir + "/memes/" + meme) + if err == nil { + http.ServeFile(w, r, dataDir+"/memes/"+meme) + } else { + mux.Vars(r)["xid"] = meme + servefile(w, r) + } } func servefile(w http.ResponseWriter, r *http.Request) {