export httpx.GetRemoteAddr

This commit is contained in:
kevin
2020-08-12 12:25:52 +08:00
committed by kingxt
parent c637f86817
commit 9428fface2
6 changed files with 11 additions and 10 deletions

View File

@@ -7,7 +7,7 @@ import (
"github.com/tal-tech/go-zero/core/load"
"github.com/tal-tech/go-zero/core/logx"
"github.com/tal-tech/go-zero/core/stat"
"github.com/tal-tech/go-zero/rest/internal"
"github.com/tal-tech/go-zero/rest/httpx"
"github.com/tal-tech/go-zero/rest/internal/security"
)
@@ -35,7 +35,7 @@ func SheddingHandler(shedder load.Shedder, metrics *stat.Metrics) func(http.Hand
metrics.AddDrop()
sheddingStat.IncrementDrop()
logx.Errorf("[http] dropped, %s - %s - %s",
r.RequestURI, internal.GetRemoteAddr(r), r.UserAgent())
r.RequestURI, httpx.GetRemoteAddr(r), r.UserAgent())
w.WriteHeader(http.StatusServiceUnavailable)
return
}