Versions in this module Expand all Collapse all v1 v1.0.2 Apr 6, 2022 Changes in this version + const CookieName + const FailureCode + const FormFieldName + const HeaderName + const MaxAge + var ErrBadReferer = errors.New(...) + var ErrBadToken = errors.New(...) + var ErrNoReferer = errors.New("A secure request contained no Referer or its value was malformed") + func Default(handler http.Handler) http.Handler + func Reason(req *http.Request) error + func Token(req *http.Request) string + func VerifyToken(realToken, sentToken string) bool + type CSRFHandler struct + func Configurable(handler http.Handler) *CSRFHandler + func (h *CSRFHandler) ExemptFunc(fn func(r *http.Request) bool) + func (h *CSRFHandler) ExemptGlob(pattern string) + func (h *CSRFHandler) ExemptGlobs(patterns ...string) + func (h *CSRFHandler) ExemptPath(path string) + func (h *CSRFHandler) ExemptPaths(paths ...string) + func (h *CSRFHandler) ExemptRegexp(re interface{}) + func (h *CSRFHandler) ExemptRegexps(res ...interface{}) + func (h *CSRFHandler) IsExempt(r *http.Request) bool + func (h *CSRFHandler) RegenerateToken(w http.ResponseWriter, r *http.Request) string + func (h *CSRFHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (h *CSRFHandler) SetBaseCookie(cookie http.Cookie) + func (h *CSRFHandler) SetFailureHandler(handler http.Handler)