use real IP address

This commit is contained in:
Wim Brand
2020-02-21 13:58:02 +01:00
parent e4eb24d8d1
commit 7a67d8c33f

View File

@@ -3,6 +3,7 @@ package webcontroller
import (
"net/http"
"fornaxian.com/pixeldrain-api/util"
"github.com/Fornaxian/log"
"github.com/julienschmidt/httprouter"
)
@@ -13,6 +14,7 @@ func (wc *WebController) serveAdClick(w http.ResponseWriter, r *http.Request, p
// Get a view token
td := wc.newTemplateData(w, r)
td.PixelAPI.RealIP = util.RemoteAddress(r)
vt := viewTokenOrBust(td.PixelAPI)
// Log a view on the file