middleware

package
v5.2.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MiddlewareChain added in v5.1.1

func MiddlewareChain(h http.Handler, mw []Middleware) http.Handler

func NormalizeQueryValues

func NormalizeQueryValues(queryParams url.Values)

NormalizeQueryValues replaces comma-separated values with individual values

func NormalizeQueryValuesHandler

func NormalizeQueryValuesHandler(next http.Handler) http.Handler

NormalizeQueryValuesHandler normalizes an input query of "key=value1,value2,value3" to "key=value1&key=value2&key=value3"

Types

type Middleware added in v5.1.1

type Middleware func(http.Handler) http.Handler

func AcceptHeaderHandler

func AcceptHeaderHandler(serverAcceptedTypes []string) Middleware

AcceptHeaderHandler checks if the client's response preference is handled

func ContentTypeHandler

func ContentTypeHandler(acceptedMediaTypes []string) Middleware

ContentTypeHandler checks request for the appropriate media types otherwise returning a http.StatusUnsupportedMediaType error

func CorsHandler

func CorsHandler(allowOrigins []string) Middleware

CorsHandler sets the cors settings on api endpoints

Jump to

Keyboard shortcuts

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