This commit is contained in:
Sebastien Laithier 2023-05-10 15:45:54 +02:00
parent 61d72cfc5b
commit 9d20d22a0b

View File

@ -10,6 +10,7 @@ import (
) )
const ( const (
// MethodPurge declaration for Varnish.
MethodPurge = "PURGE" MethodPurge = "PURGE"
) )
@ -38,6 +39,7 @@ func PurgeHandler(w http.ResponseWriter, r *http.Request) {
io.WriteString(w, status) io.WriteString(w, status)
} }
// SendToVarnish send to all varnish servers define in varnishList the PURGE request.
func SendToVarnish(url string) string { func SendToVarnish(url string) string {
status = "200 Purged" status = "200 Purged"
// Take url to ban as argument. // Take url to ban as argument.