middleware

package
v0.0.0-...-a121bc4 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2023 License: EUPL-1.2 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AcceptRequests

func AcceptRequests(logger *zap.Logger, next httprouter.Handle) httprouter.Handle

AcceptRequests returns a 405 Method Not Allowed if the request method is not GET, HEAD, or OPTIONS.

func CORS

CORS adds CORS headers to the response.

func Chain

func Chain(handler httprouter.Handle, middlewares ...func(httprouter.Handle) httprouter.Handle) httprouter.Handle

Chain wraps a given http.Handler with middlewares.

func PanicRecovery

func PanicRecovery(logger *zap.Logger, next httprouter.Handle) httprouter.Handle

PanicRecovery tries to recover from panics and returns a 500 error if there was one.

func PrivacyPolicy

func PrivacyPolicy(uri string, next httprouter.Handle) httprouter.Handle

PrivacyPolicy adds a privacy policy header to the response.

func SecureHeader

func SecureHeader(next httprouter.Handle) httprouter.Handle

SecureHeader adds basic security headers to the response.

func UserAgent

func UserAgent(logger *zap.Logger, next httprouter.Handle) httprouter.Handle

UserAgent ensures that the request has a valid user agent.

Types

This section is empty.

Jump to

Keyboard shortcuts

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