commit 334a10ecef2c27ed1d9ef9cffd10cbb0b7f5002c from: Oliver Lowe date: Tue Mar 12 23:51:53 2024 UTC abub/apserve: remove old unused apub file handlers This stuff is generated programaticall now. commit - 186ac3bf2ba1c6ae3e5844233d7162521e2c79ed commit + 334a10ecef2c27ed1d9ef9cffd10cbb0b7f5002c blob - b3fa6acf4742dceed3c6035813956a1de723ddbe blob + c2b8a3a95b8c9a282efe093aa9f1f503c884a592 --- cmd/apserve/listen.go +++ cmd/apserve/listen.go @@ -140,29 +140,6 @@ func (srv *server) handleInbox(w http.ResponseWriter, w.WriteHeader(http.StatusAccepted) } -func logRequest(next http.Handler) http.HandlerFunc { - return func(w http.ResponseWriter, req *http.Request) { - // skip logging from checks by load balancer - if req.URL.Path == "/" && req.Method == http.MethodHead { - next.ServeHTTP(w, req) - return - } - addr := req.RemoteAddr - if req.Header.Get("X-Forwarded-For") != "" { - addr = req.Header.Get("X-Forwarded-For") - } - log.Printf("%s %s %s", addr, req.Method, req.URL) - next.ServeHTTP(w, req) - } -} - -func serveActorFile(name string) http.HandlerFunc { - return func(w http.ResponseWriter, req *http.Request) { - w.Header().Set("Content-Type", apub.ContentType) - http.ServeFile(w, req, name) - } -} - func serveActivityFile(hfsys http.Handler) http.HandlerFunc { return func(w http.ResponseWriter, req *http.Request) { w.Header().Set("Content-Type", apub.ContentType)