//ValidateCSRF validates csrf token for request func ValidateCSRF(request prago.Request) { token := CSRFToken(request) if len(token) == 0 { panic("token not set") } paramsToken := request.Params().Get("_csrfToken") if paramsToken != token { panic("Wrong CSRF token") } }
func Newsletter(request prago.Request) { email := request.Params().Get("email") println(email) prago.Redirect(request, "/index.html?submitted") }