csp

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2025 License: BSD-3-Clause, GPL-3.0, MIT, + 1 more Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InlineScript inlineKind = iota
	InlineStyle
)

Variables

This section is empty.

Functions

func PatchHeaders

func PatchHeaders(h http.Header, kind inlineKind) (nonce string)

PatchHeaders mutates headers so an inline <script> or <style> element can run. Returns the nonce to place on the inline tag. Returns "" if no patch was needed (e.g., CSP already allowed inline) or no CSP headers were present.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL