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 --- ui/oauth2_callback.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'ui/oauth2_callback.go') diff --git a/ui/oauth2_callback.go b/ui/oauth2_callback.go index f564c7ef..23e379b2 100644 --- a/ui/oauth2_callback.go +++ b/ui/oauth2_callback.go @@ -16,8 +16,6 @@ import ( "github.com/miniflux/miniflux/logger" "github.com/miniflux/miniflux/model" "github.com/miniflux/miniflux/ui/session" - - "github.com/tomasen/realip" ) // OAuth2Callback receives the authorization code and create a new session. @@ -107,7 +105,7 @@ func (c *Controller) OAuth2Callback(w http.ResponseWriter, r *http.Request) { } } - sessionToken, _, err := c.store.CreateUserSession(user.Username, r.UserAgent(), realip.RealIP(r)) + sessionToken, _, err := c.store.CreateUserSession(user.Username, r.UserAgent(), request.RealIP(r)) if err != nil { html.ServerError(w, err) return -- cgit v1.2.3