Versions in this module Expand all Collapse all v2 v2.0.2 May 24, 2023 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 NewPure(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 New(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) Other modules containing this package github.com/belua/nosurf