middlewares

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAccessLog

func NewAccessLog() *negroni.Logger

NewLogger returns a new Logger instance

Types

type NoCacheHeadersMiddleware

type NoCacheHeadersMiddleware struct{}

func NewNoCacheHeadersMiddleware

func NewNoCacheHeadersMiddleware() *NoCacheHeadersMiddleware

func (*NoCacheHeadersMiddleware) ServeHTTP

NoCache is a simple piece of middleware that sets a number of HTTP headers to prevent a router (or subrouter) from being cached by an upstream proxy and/or client.

As per http://wiki.nginx.org/HttpProxyModule - NoCache sets:

Expires: Thu, 01 Jan 1970 00:00:00 UTC
Cache-Control: no-cache, private, max-age=0
X-Accel-Expires: 0
Pragma: no-cache (for HTTP/1.0 proxies/clients)

type RequireContentTypeMiddleware

type RequireContentTypeMiddleware struct {
	AllowedContentType string
}

func NewRequireContentTypeMiddleware

func NewRequireContentTypeMiddleware(allowedContentType string) *RequireContentTypeMiddleware

func (*RequireContentTypeMiddleware) ServeHTTP

AllowContentType enforces a whitelist of request Content-Types otherwise responds with a 415 Unsupported Media Type status.

type SecurityHeadersMiddleware

type SecurityHeadersMiddleware struct{}

func NewRespondWithSecurityHeadersMiddleware

func NewRespondWithSecurityHeadersMiddleware() *SecurityHeadersMiddleware

func (*SecurityHeadersMiddleware) ServeHTTP

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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