csrftoken

package
v0.0.76 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2025 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMiddleware added in v0.0.22

func NewMiddleware(opts Opts) func(http.Handler) http.Handler

Types

type GetExpectedCSRFToken

type GetExpectedCSRFToken = func(r *http.Request) string

type GetSubmittedCSRFToken

type GetSubmittedCSRFToken = func(r *http.Request) string

type Opts

type Opts struct {
	GetExpectedCSRFToken  GetExpectedCSRFToken
	GetSubmittedCSRFToken GetSubmittedCSRFToken
	GetIsExempt           func(r *http.Request) bool // Exempts from CSRF token check (not host check)
	PermittedHosts        []string                   // If len == 0, all hosts are permitted
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL