all repos — homestead @ 52c7a311770809e20c790078ddf27ea4fa10c77e

Code for my website

unify identity service registration

Alan Pearce
commit

52c7a311770809e20c790078ddf27ea4fa10c77e

parent

030b21d454c51121f56b1da423c592ef4e6f3618

1 file changed, 2 insertions(+), 16 deletions(-)

changed files
M domain/identity/webfinger/service.godomain/identity/webfinger/service.go
@@ -43,12 +43,8 @@
return service } -func (s *Service) RegisterHandlers(mux *http.ServeMux) { - mux.HandleFunc("/.well-known/webfinger", s.handleWebFinger) -} - -func (s *Service) Handler() http.HandlerFunc { - return s.handleWebFinger +func (s *Service) RegisterHandlers(mux *ihttp.ServeMux) { + mux.HandleFunc("/.well-known/webfinger", s.HandleFunc) } func (s *Service) HandleFunc(w http.ResponseWriter, r *http.Request) ihttp.Error {
@@ -75,13 +71,3 @@ }
return ihttp.NotFound("Resource not found") } - -func (s *Service) handleWebFinger(w http.ResponseWriter, r *http.Request) { - if err := s.HandleFunc(w, r); err != nil { - status := err.StatusCode() - if status == 0 { - status = http.StatusInternalServerError - } - http.Error(w, err.Error(), status) - } -}