diff options
author | 2018-06-01 07:22:18 -0700 | |
---|---|---|
committer | 2018-06-01 07:22:31 -0700 | |
commit | 3b39f0883c60b6978c6c6df2c0029bd4c96613fe (patch) | |
tree | f601e0fc314da8cee5001f208b46482262f5be14 /middleware/logging.go | |
parent | cf7a7e25fbf94c16ca08ff3e889bdd4373751e2c (diff) | |
download | v2-3b39f0883c60b6978c6c6df2c0029bd4c96613fe.tar.gz v2-3b39f0883c60b6978c6c6df2c0029bd4c96613fe.tar.zst v2-3b39f0883c60b6978c6c6df2c0029bd4c96613fe.zip |
Rewrite RealIP() to avoid returning an empty string
Diffstat (limited to 'middleware/logging.go')
-rw-r--r-- | middleware/logging.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/middleware/logging.go b/middleware/logging.go index a6c141b5..48158b43 100644 --- a/middleware/logging.go +++ b/middleware/logging.go @@ -7,15 +7,14 @@ package middleware import ( "net/http" + "github.com/miniflux/miniflux/http/request" "github.com/miniflux/miniflux/logger" - - "github.com/tomasen/realip" ) // Logging logs the HTTP request. func (m *Middleware) Logging(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - logger.Debug("[HTTP] %s %s %s", realip.RealIP(r), r.Method, r.RequestURI) + logger.Debug("[HTTP] %s %s %s", request.RealIP(r), r.Method, r.RequestURI) next.ServeHTTP(w, r) }) } |