From 3b39f0883c60b6978c6c6df2c0029bd4c96613fe Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Fri, 1 Jun 2018 07:22:18 -0700 Subject: Rewrite RealIP() to avoid returning an empty string --- middleware/logging.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'middleware') diff --git a/middleware/logging.go b/middleware/logging.go index a6c141b..48158b4 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) }) } -- cgit v1.2.3