This commit is contained in:
parent
2e73689762
commit
de23b3e815
@ -73,7 +73,7 @@ func (s *Server) Start() error {
|
|||||||
for {
|
for {
|
||||||
conn, err := listener.Accept()
|
conn, err := listener.Accept()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("error accepting connection: %v", err)
|
log.WithError(err).Error("error accepting connection")
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,12 +99,14 @@ func (s *Server) getInfo(w http.ResponseWriter, _ *http.Request) {
|
|||||||
Version: config.GetVersion(),
|
Version: config.GetVersion(),
|
||||||
}, "", " ")
|
}, "", " ")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
log.WithError(err).Error("failed to marshal info")
|
||||||
w.WriteHeader(http.StatusInternalServerError)
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send Response
|
// Send Response
|
||||||
w.Header().Set("Content-Type", "application/json")
|
w.Header().Set("Content-Type", "application/json")
|
||||||
|
w.WriteHeader(http.StatusOK)
|
||||||
_, _ = w.Write(d)
|
_, _ = w.Write(d)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user