Documentation
¶
Index ¶
- func NewSecureCookie(name, value string, options CookieOptions) *http.Cookie
- func SetSecureCookie(w http.ResponseWriter, name, value string, options CookieOptions)
- type CSP
- func (c *CSP) Add(directive string, values ...string) *CSP
- func (c *CSP) BaseURI(values ...string) *CSP
- func (c *CSP) ConnectSrc(values ...string) *CSP
- func (c *CSP) DefaultSrc(values ...string) *CSP
- func (c *CSP) FontSrc(values ...string) *CSP
- func (c *CSP) FormAction(values ...string) *CSP
- func (c *CSP) FrameAncestors(values ...string) *CSP
- func (c *CSP) ImgSrc(values ...string) *CSP
- func (c *CSP) ObjectSrc(values ...string) *CSP
- func (c *CSP) ScriptSrc(values ...string) *CSP
- func (c *CSP) Set(directive string, values ...string) *CSP
- func (c *CSP) String() string
- func (c *CSP) StyleSrc(values ...string) *CSP
- func (c *CSP) UpgradeInsecureRequests() *CSP
- type CookieOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSecureCookie ¶
func NewSecureCookie(name, value string, options CookieOptions) *http.Cookie
NewSecureCookie creates a cookie with secure defaults.
func SetSecureCookie ¶
func SetSecureCookie(w http.ResponseWriter, name, value string, options CookieOptions)
SetSecureCookie writes a secure cookie to the response.
Types ¶
type CSP ¶
type CSP struct {
// contains filtered or unexported fields
}
CSP builds a Content-Security-Policy header value.
func (*CSP) ConnectSrc ¶
ConnectSrc sets the connect-src directive.
func (*CSP) DefaultSrc ¶
DefaultSrc sets the default-src directive.
func (*CSP) FormAction ¶
FormAction sets the form-action directive.
func (*CSP) FrameAncestors ¶
FrameAncestors sets the frame-ancestors directive.
func (*CSP) UpgradeInsecureRequests ¶
UpgradeInsecureRequests adds the upgrade-insecure-requests directive.
Click to show internal directories.
Click to hide internal directories.