Custom HTTP response writer

This commit is contained in:
binwiederhier 2023-02-17 09:07:57 -05:00
parent 7fb6f794e5
commit db1a1fec0c
2 changed files with 58 additions and 0 deletions

View file

@ -291,6 +291,7 @@ func (s *Server) closeDatabases() {
// handle is the main entry point for all HTTP requests
func (s *Server) handle(w http.ResponseWriter, r *http.Request) {
w = newHTTPResponseWriter(w) // Avoid logging "superfluous response.WriteHeader call" warning
v, err := s.maybeAuthenticate(r) // Note: Always returns v, even when error is returned
if err != nil {
s.handleError(w, r, v, err)