return 406 not acceptable for donks as honks
Ted Unangst tedu@tedunangst.com
Fri, 16 Feb 2024 13:32:00 -0500
1 files changed,
5 insertions(+),
0 deletions(-)
jump to
M
web.go
→
web.go
@@ -2393,6 +2393,11 @@ }
} func servefile(w http.ResponseWriter, r *http.Request) { + if friendorfoe(r.Header.Get("Accept")) { + dlog.Printf("incompatible accept for donk") + http.Error(w, "there are no activities here", http.StatusNotAcceptable) + return + } xid := mux.Vars(r)["xid"] preview := r.FormValue("preview") == "1" var media string