From 5d9dbd84c9ed2c8692d66558b8c73c3356aca843 Mon Sep 17 00:00:00 2001 From: Wim Brand Date: Wed, 26 Feb 2020 17:34:01 +0100 Subject: [PATCH] hide referer url --- res/template/hide_refer.html | 22 ++++++++++++++++++++++ webcontroller/ad_click.go | 3 +++ 2 files changed, 25 insertions(+) create mode 100644 res/template/hide_refer.html diff --git a/res/template/hide_refer.html b/res/template/hide_refer.html new file mode 100644 index 0000000..078eb36 --- /dev/null +++ b/res/template/hide_refer.html @@ -0,0 +1,22 @@ +{{define "hide_refer"}} + + + You are being redirected + + + + + You are being redirected.
+
+ If it doesn't work. Click here. + + + + +{{end}} diff --git a/webcontroller/ad_click.go b/webcontroller/ad_click.go index 705a539..65038bb 100644 --- a/webcontroller/ad_click.go +++ b/webcontroller/ad_click.go @@ -14,8 +14,11 @@ import ( func (wc *WebController) serveAdClick(w http.ResponseWriter, r *http.Request, p httprouter.Params) { // Redirect the user to the target page + w.Header().Set("Referrer-Policy", "origin") http.Redirect(w, r, r.URL.Query().Get("target"), http.StatusTemporaryRedirect) + // wc.templates.Get().ExecuteTemplate(w, "hide_refer", r.URL.Query().Get("target")) + api := pixelapi.New(wc.apiURLInternal) // The Real IP is used in the API server to determine that the view is not