csp

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2026 License: BSD-3-Clause, GPL-3.0, MIT, + 1 more Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Script tagKind = iota
	Style
)

Variables

This section is empty.

Functions

func NewNonce added in v1.3.0

func NewNonce() string

NewNonce generates a cryptographically random nonce for CSP.

func PatchHeadersBatch added in v1.3.0

func PatchHeadersBatch(res *http.Response, operations []PatchOperation) error

PatchHeadersBatch mutates CSP headers and meta tags for multiple resources in a single pass.

Types

type PatchOperation added in v1.3.0

type PatchOperation struct {
	Nonce       string
	Kind        tagKind
	ResourceURL string
}

PatchOperation represents a single CSP patch with its nonce and target resource.

Jump to

Keyboard shortcuts

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