Documentation
¶
Index ¶
- Constants
- func MergeOrigins(lists ...[]string) []string
- func Nonce(r *http.Request) string
- func RequestIsHTTPS(r *http.Request) bool
- type 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
- type Request
- type Settings
Constants ¶
View Source
const ( KeyXFrameOptions = "security_x_frame_options" KeyHSTSMaxAge = "security_hsts_max_age_seconds" KeyHSTSIncludeSubs = "security_hsts_include_subdomains" KeyHSTSPreload = "security_hsts_preload" KeyHSTSDisabled = "security_hsts_disabled" KeyCSP = "security_csp" KeyCSPExtra = "security_csp_extra" KeyXContentTypeOptions = "security_x_content_type_options" KeyReferrerPolicy = "security_referrer_policy" KeyPermissionsPolicy = "security_permissions_policy" KeyCORSOrigins = "security_cors_allowed_origins" )
Variables ¶
This section is empty.
Functions ¶
func MergeOrigins ¶
func RequestIsHTTPS ¶
Types ¶
type Config ¶
type Config struct {
XFrameOptions string
HSTSMaxAgeSeconds int
HSTSIncludeSubDomains bool
HSTSPreload bool
HSTSDisabled bool
CSP *CSP
XContentTypeOptions string
ReferrerPolicy string
PermissionsPolicy string
CORSAllowedOrigins []string
CORSAllowedHeaders []string
StyleNonce bool
NoStoreCacheControl string
StaticPrefixes []string
StaticPaths []string
StaticCacheControl string
LegacyHeaders bool
PerRequest func(r *http.Request, rq *Request)
}
func (*Config) ApplySettings ¶
Click to show internal directories.
Click to hide internal directories.