middleware

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SecurityHeaderDefaults = map[string]string{
	"X-Content-Type-Options":       "nosniff",
	"X-Frame-Options":              "DENY",
	"Strict-Transport-Security":    "max-age=31536000; includeSubDomains",
	"Referrer-Policy":              "strict-origin-when-cross-origin",
	"Cache-Control":                "no-store",
	"Cross-Origin-Opener-Policy":   "same-origin",
	"Cross-Origin-Resource-Policy": "same-site",
}

Functions

func SecurityHeadersMiddleware

func SecurityHeadersMiddleware(next http.Handler, customHeaders map[string]string) http.Handler

SecurityHeadersMiddleware adds baseline HTTP security headers to every response. Content-Security-Policy is managed at the infrastructure level and is omitted here.

Types

This section is empty.

Jump to

Keyboard shortcuts

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