mirror of
https://github.com/fatedier/frp.git
synced 2026-01-11 22:23:12 +00:00
vnet: fix issues (#4771)
This commit is contained in:
@@ -97,14 +97,14 @@ func (svr *Service) healthz(w http.ResponseWriter, _ *http.Request) {
|
||||
func (svr *Service) apiServerInfo(w http.ResponseWriter, r *http.Request) {
|
||||
res := GeneralResponse{Code: 200}
|
||||
defer func() {
|
||||
log.Infof("Http response [%s]: code [%d]", r.URL.Path, res.Code)
|
||||
log.Infof("http response [%s]: code [%d]", r.URL.Path, res.Code)
|
||||
w.WriteHeader(res.Code)
|
||||
if len(res.Msg) > 0 {
|
||||
_, _ = w.Write([]byte(res.Msg))
|
||||
}
|
||||
}()
|
||||
|
||||
log.Infof("Http request: [%s]", r.URL.Path)
|
||||
log.Infof("http request: [%s]", r.URL.Path)
|
||||
serverStats := mem.StatsCollector.GetServer()
|
||||
svrResp := serverInfoResp{
|
||||
Version: version.Full(),
|
||||
@@ -218,13 +218,13 @@ func (svr *Service) apiProxyByType(w http.ResponseWriter, r *http.Request) {
|
||||
proxyType := params["type"]
|
||||
|
||||
defer func() {
|
||||
log.Infof("Http response [%s]: code [%d]", r.URL.Path, res.Code)
|
||||
log.Infof("http response [%s]: code [%d]", r.URL.Path, res.Code)
|
||||
w.WriteHeader(res.Code)
|
||||
if len(res.Msg) > 0 {
|
||||
_, _ = w.Write([]byte(res.Msg))
|
||||
}
|
||||
}()
|
||||
log.Infof("Http request: [%s]", r.URL.Path)
|
||||
log.Infof("http request: [%s]", r.URL.Path)
|
||||
|
||||
proxyInfoResp := GetProxyInfoResp{}
|
||||
proxyInfoResp.Proxies = svr.getProxyStatsByType(proxyType)
|
||||
@@ -290,13 +290,13 @@ func (svr *Service) apiProxyByTypeAndName(w http.ResponseWriter, r *http.Request
|
||||
name := params["name"]
|
||||
|
||||
defer func() {
|
||||
log.Infof("Http response [%s]: code [%d]", r.URL.Path, res.Code)
|
||||
log.Infof("http response [%s]: code [%d]", r.URL.Path, res.Code)
|
||||
w.WriteHeader(res.Code)
|
||||
if len(res.Msg) > 0 {
|
||||
_, _ = w.Write([]byte(res.Msg))
|
||||
}
|
||||
}()
|
||||
log.Infof("Http request: [%s]", r.URL.Path)
|
||||
log.Infof("http request: [%s]", r.URL.Path)
|
||||
|
||||
var proxyStatsResp GetProxyStatsResp
|
||||
proxyStatsResp, res.Code, res.Msg = svr.getProxyStatsByTypeAndName(proxyType, name)
|
||||
@@ -358,13 +358,13 @@ func (svr *Service) apiProxyTraffic(w http.ResponseWriter, r *http.Request) {
|
||||
name := params["name"]
|
||||
|
||||
defer func() {
|
||||
log.Infof("Http response [%s]: code [%d]", r.URL.Path, res.Code)
|
||||
log.Infof("http response [%s]: code [%d]", r.URL.Path, res.Code)
|
||||
w.WriteHeader(res.Code)
|
||||
if len(res.Msg) > 0 {
|
||||
_, _ = w.Write([]byte(res.Msg))
|
||||
}
|
||||
}()
|
||||
log.Infof("Http request: [%s]", r.URL.Path)
|
||||
log.Infof("http request: [%s]", r.URL.Path)
|
||||
|
||||
trafficResp := GetProxyTrafficResp{}
|
||||
trafficResp.Name = name
|
||||
@@ -386,9 +386,9 @@ func (svr *Service) apiProxyTraffic(w http.ResponseWriter, r *http.Request) {
|
||||
func (svr *Service) deleteProxies(w http.ResponseWriter, r *http.Request) {
|
||||
res := GeneralResponse{Code: 200}
|
||||
|
||||
log.Infof("Http request: [%s]", r.URL.Path)
|
||||
log.Infof("http request: [%s]", r.URL.Path)
|
||||
defer func() {
|
||||
log.Infof("Http response [%s]: code [%d]", r.URL.Path, res.Code)
|
||||
log.Infof("http response [%s]: code [%d]", r.URL.Path, res.Code)
|
||||
w.WriteHeader(res.Code)
|
||||
if len(res.Msg) > 0 {
|
||||
_, _ = w.Write([]byte(res.Msg))
|
||||
|
||||
Reference in New Issue
Block a user