hsts

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2026 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HSTS

type HSTS struct {
	MaxAge            time.Duration
	IncludeSubDomains bool
	Preload           bool

	// ShareValueSlice writes the Strict-Transport-Security value from a single
	// slice shared across requests instead of allocating one per request. The
	// value is fixed at construction, so this is safe as long as nothing
	// mutates the response header value slice in place. Off by default; see
	// header.SetShared.
	ShareValueSlice bool
}

HSTS middleware

func Default

func Default() *HSTS

Default returns default hsts

func Preload

func Preload() *HSTS

Preload returns hsts preload

func (HSTS) ServeHandler

func (m HSTS) ServeHandler(h http.Handler) http.Handler

ServeHandler implements middleware interface

Jump to

Keyboard shortcuts

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