mirror of
https://codeberg.org/angestoepselt/homepage.git
synced 2026-03-21 22:32:17 +00:00
25 lines
571 B
Go
25 lines
571 B
Go
package csp
|
|
|
|
const (
|
|
ScriptSrc = "script-src"
|
|
)
|
|
|
|
func (csp *Builder) WithScript(src ...string) *Builder {
|
|
return csp.WithValue(ScriptSrc, src...)
|
|
}
|
|
|
|
func (csp *Builder) WithScriptSelf() *Builder {
|
|
return csp.WithKeyword(ScriptSrc, Self)
|
|
}
|
|
|
|
func (csp *Builder) WithScriptTrustedTypesEval() *Builder {
|
|
return csp.WithKeyword(ScriptSrc, TrustedTypesEval)
|
|
}
|
|
|
|
func (csp *Builder) WithScriptInlineSpeculationRules() *Builder {
|
|
return csp.WithKeyword(ScriptSrc, InlineSpeculationRules)
|
|
}
|
|
|
|
func (csp *Builder) WithScriptNonce() *Builder {
|
|
return csp.WithNonce(ScriptSrc)
|
|
}
|