Help us shape the future of Go! Take the 2026 Go Developer Survey

secure

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(configs ...Config) zinc.Middleware

New applies security headers. HSTS is emitted only for requests Zinc considers secure, including trusted-proxy scheme handling.

Types

type Config

type Config struct {
	XSSProtection                   string
	ContentTypeNosniff              string
	XFrameOptions                   string
	HSTSMaxAge                      int
	HSTSExcludeSubdomains           bool
	ContentSecurityPolicy           string
	ContentSecurityPolicyReportOnly string
	ReferrerPolicy                  string
	CrossOriginResourcePolicy       string
	PermissionsPolicy               string
}

Config controls defensive browser response headers.

Jump to

Keyboard shortcuts

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