diff --git a/app/main.go b/app/main.go index 6930a7b..e9011ec 100644 --- a/app/main.go +++ b/app/main.go @@ -32,10 +32,12 @@ func MakeVarnishList() []string { // PurgeHandler handles PURGE request to broadcast it to all varnish instances. func PurgeHandler(w http.ResponseWriter, r *http.Request) { url := r.URL.String() + remoteAddr := r.RemoteAddr status := SendToVarnish(url) if status != "200 Purged" { w.WriteHeader(405) } + log.Println(remoteAddr + " Requested purge on " + url + " : " + status) io.WriteString(w, status) } @@ -59,7 +61,6 @@ func SendToVarnish(url string) string { if resp.StatusCode != 200 { status = "405 Not Allowed" } - log.Println("Purge " + domain + url + " : " + status) } return status }