MCPcopy
hub / github.com/caddyserver/caddy / CaddyfileHeaderOp

Function CaddyfileHeaderOp

modules/caddyhttp/headers/caddyfile.go:221–223  ·  view source on GitHub ↗

CaddyfileHeaderOp applies a new header operation according to field, value, and replacement. The field can be prefixed with "+" or "-" to specify adding or removing; otherwise, the value will be set (overriding any previous value). If replacement is non-nil, value will be treated as a regular expres

(ops *HeaderOps, field, value string, replacement *string)

Source from the content-addressed store, hash-verified

219// complete the substring replacement; in that case, any + or -
220// prefix to field will be ignored.
221func CaddyfileHeaderOp(ops *HeaderOps, field, value string, replacement *string) error {
222 return applyHeaderOp(ops, nil, field, value, replacement)
223}
224
225func applyHeaderOp(ops *HeaderOps, respHeaderOps *RespHeaderOps, field, value string, replacement *string) error {
226 switch {

Callers 3

parseCaddyfileFunction · 0.92
UnmarshalCaddyfileMethod · 0.92
parseReqHdrCaddyfileFunction · 0.85

Calls 1

applyHeaderOpFunction · 0.85

Tested by

no test coverage detected