middleware

package
v0.10.5 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTTPSOnly added in v0.10.2

func HTTPSOnly(next types.Handler, req *http.Request) *http.Response

HTTPSOnly redirects all http requests to https. In case no Host header is provided, 400 Bad Request will be returned without calling the actual handler.

Note: it causes 1 (one) allocation

func Recover

func Recover(next types.Handler, req *http.Request) (resp *http.Response)

Recover is a basic middleware that catches any panics, and returns 500 Internal Server Error instead. Response headers and body are being discarded in consistency purposes, avoiding half-cooked response being sent

Types

This section is empty.

Jump to

Keyboard shortcuts

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