csrp

package module
v0.0.0-...-383d894 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2021 License: MIT Imports: 6 Imported by: 0

README

csrp

This is a version of https://github.com/DrJLT/csrf with more flexibility in usage. It supports httprouter.Handle and is supposed to be used in select routers only.

It is an ultra-light CSRF protection.

To be used as

router.POST("/protected", csrp.CSRF(protectedHandle))
router.POST("/unprotected", unprotectedHandle)

in the route definition.

To get the token, use

csrp.Token(w http.ResponseWriter, r *http.Request) string

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Token

func Token(w http.ResponseWriter, r *http.Request) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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