hide referer url
This commit is contained in:
22
res/template/hide_refer.html
Normal file
22
res/template/hide_refer.html
Normal file
@@ -0,0 +1,22 @@
|
||||
{{define "hide_refer"}}<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>You are being redirected</title>
|
||||
<!-- <meta http-equiv="refresh" content="0; {{.}}" /> -->
|
||||
<style>html, body {background-color: #000000;}</style>
|
||||
</head>
|
||||
<body>
|
||||
You are being redirected.<br/>
|
||||
<br/>
|
||||
If it doesn't work. <a id="link" href="{{.}}">Click here</a>.
|
||||
|
||||
<script>
|
||||
var a = document.getElementById("link");
|
||||
if(!a.click) {
|
||||
window.location = "{{.}}";
|
||||
}
|
||||
a.click();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
{{end}}
|
@@ -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
|
||||
|
Reference in New Issue
Block a user