Documentation
¶
Index ¶
Constants ¶
View Source
const CSPNonceLocalKey = "csp_nonce"
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(config ...Config) fh.HandlerFunc
Types ¶
type Config ¶
type Config struct {
ContentSecurityPolicy string
ContentSecurityPolicyReportOnly string
CSPNonce bool
CSPNonceDirectives []string
HSTSMaxAge int
HSTSIncludeSubDomains bool
HSTSPreload bool
FrameDeny bool
ContentTypeNosniff bool
XSSProtection string
CrossOriginOpenerPolicy string
CrossOriginResourcePolicy string
CrossOriginEmbedderPolicy string
ReferrerPolicy string
PermissionsPolicy string
// Disable* fields make it possible to turn off an individual default while
// retaining the rest of the middleware's secure baseline.
DisableFrameDeny bool
DisableContentTypeNosniff bool
DisableHSTS bool
}
Click to show internal directories.
Click to hide internal directories.