From 7a67d8c33fbfe3f7b3bbdfbe01ad539f9f4d4548 Mon Sep 17 00:00:00 2001 From: Wim Brand Date: Fri, 21 Feb 2020 13:58:02 +0100 Subject: [PATCH] use real IP address --- webcontroller/ad_click.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/webcontroller/ad_click.go b/webcontroller/ad_click.go index c78da32..196179b 100644 --- a/webcontroller/ad_click.go +++ b/webcontroller/ad_click.go @@ -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