Skip to content

Commit 51ff58a

Browse files
committed
Fix roundtrip loglevel
1 parent d490757 commit 51ff58a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

server.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,15 +603,18 @@ func (s *Server) listen(l net.Listener, identifier id.ID) {
603603
func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
604604
resp, err := s.RoundTrip(r)
605605
if err != nil {
606+
level := 0
606607
code := http.StatusBadGateway
607608
if err == errUnauthorised {
608609
w.Header().Set("WWW-Authenticate", "Basic realm=\"User Visible Realm\"")
610+
level = 1
609611
code = http.StatusUnauthorized
610612
} else if err == errClientNotSubscribed {
613+
level = 2
611614
code = http.StatusNotFound
612615
}
613616
s.logger.Log(
614-
"level", 0,
617+
"level", level,
615618
"action", "round trip failed",
616619
"addr", r.RemoteAddr,
617620
"host", r.Host,

0 commit comments

Comments
 (0)