Skip to content

Commit

Permalink
add error logging for HTTP redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
or-else committed Aug 27, 2022
1 parent 8c4b1f0 commit 59f89b0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion server/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ func listenAndServe(addr string, mux *http.ServeMux, tlfConf *tls.Config, stop <
globals.tlsRedirectHTTP, addr)

// This is a second HTTP server listenning on a different port.
go http.ListenAndServe(globals.tlsRedirectHTTP, tlsRedirect(addr))
go func() {
if err := http.ListenAndServe(globals.tlsRedirectHTTP, tlsRedirect(addr)); err != nil && err != http.ErrServerClosed {
logs.Info.Println("HTTP redirect failed:", err)
}
}()
}
}

Expand Down

0 comments on commit 59f89b0

Please sign in to comment.