This commit is contained in:
parent
2e73689762
commit
4ab6f166b0
@ -93,19 +93,26 @@ func (s *Server) getInfo(w http.ResponseWriter, _ *http.Request) {
|
||||
}
|
||||
s.mu.RUnlock()
|
||||
|
||||
fmt.Println(1)
|
||||
|
||||
// Create Response
|
||||
d, err := json.MarshalIndent(InfoResponse{
|
||||
Tunnels: allTunnels,
|
||||
Version: config.GetVersion(),
|
||||
}, "", " ")
|
||||
if err != nil {
|
||||
fmt.Println(4)
|
||||
log.WithError(err).Error("failed to marshal info")
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println(2, string(d))
|
||||
|
||||
// Send Response
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
_, _ = w.Write(d)
|
||||
fmt.Println(3)
|
||||
}
|
||||
|
||||
func (s *Server) handleRawConnection(conn net.Conn) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user