middlewares

package
v0.0.0-...-4953ef6 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CORSMiddleware

func CORSMiddleware(allowedDomains []string) func(h http.Handler) http.Handler

CORSMiddleware allows CORS on specific domains set by the server

Types

type CSRF

type CSRF interface {
	Middleware(h http.Handler) http.Handler
	Token(*http.Request) string
}

CSRF is a csrf middleware and token interface

type Nosurf

type Nosurf struct {
	ExemptFunc func(r *http.Request) bool
}

Nosurf satisfies the CSRF interface

func (Nosurf) Middleware

func (n Nosurf) Middleware(h http.Handler) http.Handler

Middleware gets the csrf middleware

func (Nosurf) Token

func (Nosurf) Token(r *http.Request) string

Token gets the csrf token for that request

Jump to

Keyboard shortcuts

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