Versions in this module Expand all Collapse all v1 v1.4.2 Nov 11, 2026 v1.4.1 Nov 11, 2026 v1.4.0 Nov 11, 2026 Changes in this version + const ErrCORS + const ErrCSPExtra + const ErrCSPFull + const ErrCSPUnsafe + const ErrHSTSMaxAge + const ErrHSTSPreload + const ErrNoSniff + const ErrPermissions + const ErrReferrer + const ErrXFrame + var ReferrerChoices = []string + var XFrameChoices = []string + func Fingerprint(get Settings) string + type Change struct + Key string + New string + Old string + type Editor struct + Get Settings + Live *Live + Reload func() + Set func(key, value string) error + func (e *Editor) Load() View + func (e *Editor) Reset() ([]Change, error) + func (e *Editor) Save(vals map[string]string) ([]Change, error) + func (e *Editor) Validate(f Form) (map[string]string, map[string]string) + type EffectiveHeaders struct + CORSOrigins string + CSP string + ContentTypeOpts string + HSTS string + PermissionsPolicy string + ReferrerPolicy string + XFrameOptions string + type Form struct + CORSOrigins string + CSPExtra string + CSPFull string + ContentTypeOptions string + HSTSDisabled bool + HSTSIncludeSubs bool + HSTSMaxAge string + HSTSPreload bool + PermissionsPolicy string + ReferrerPolicy string + XFrameOptions string + func FormFromRequest(r *http.Request) Form + type Live struct + func NewLive(build func() *Config) *Live + func (l *Live) CORS(next http.Handler) http.Handler + func (l *Live) Config() *Config + func (l *Live) Middleware(next http.Handler) http.Handler + func (l *Live) Reload() *Config + func (l *Live) Watch(interval time.Duration, fingerprint func() string) + type View struct + Defaults EffectiveHeaders + Effective EffectiveHeaders + Errors map[string]string + Form Form v1.3.0 Nov 9, 2026 Changes in this version + const KeyCORSOrigins + const KeyCSP + const KeyCSPExtra + const KeyHSTSDisabled + const KeyHSTSIncludeSubs + const KeyHSTSMaxAge + const KeyHSTSPreload + const KeyPermissionsPolicy + const KeyReferrerPolicy + const KeyXContentTypeOptions + const KeyXFrameOptions + func MergeOrigins(lists ...[]string) []string + func Nonce(r *http.Request) string + func RequestIsHTTPS(r *http.Request) bool + type CSP struct + func NewCSP() *CSP + func ParseCSP(s string) *CSP + func (c *CSP) Add(directive string, sources ...string) *CSP + func (c *CSP) Clone() *CSP + func (c *CSP) Has(directive string) bool + func (c *CSP) Remove(directive string) *CSP + func (c *CSP) Set(directive string, sources ...string) *CSP + func (c *CSP) Sources(directive string) []string + func (c *CSP) String() string + type Config struct + CORSAllowedHeaders []string + CORSAllowedOrigins []string + CSP *CSP + HSTSDisabled bool + HSTSIncludeSubDomains bool + HSTSMaxAgeSeconds int + HSTSPreload bool + LegacyHeaders bool + NoStoreCacheControl string + PerRequest func(r *http.Request, rq *Request) + PermissionsPolicy string + ReferrerPolicy string + StaticCacheControl string + StaticPaths []string + StaticPrefixes []string + StyleNonce bool + XContentTypeOptions string + XFrameOptions string + func Defaults() *Config + func (c *Config) ApplySettings(get Settings) + func (c *Config) CORS(next http.Handler) http.Handler + func (c *Config) Middleware(next http.Handler) http.Handler + type Request struct + CSP *CSP + CacheControl string + Headers map[string]string + OmitFrameOptions bool + type Settings func(key string) string