Skip to content

Conversation

@tpaulus
Copy link
Contributor

@tpaulus tpaulus commented Jan 6, 2026

When JSON config contains "response": {} in reverse_proxy or headers middleware, the RespHeaderOps struct is created but the embedded *HeaderOps pointer is nil. Calling ApplyTo on this nil pointer causes a panic.

This is a follow-up to af2d33a which made Provision nil-safe for the same reason. This change applies the same pattern to ApplyTo.

Related to #6893

Assistance Disclosure

Claude Code was consulted for this code, but I authored/coded it myself.

When JSON config contains "response": {} in reverse_proxy or headers
middleware, the RespHeaderOps struct is created but the embedded
*HeaderOps pointer is nil. Calling ApplyTo on this nil pointer causes
a panic.

This is a follow-up to af2d33a which made Provision nil-safe for the
same reason. This change applies the same pattern to ApplyTo.

Related to caddyserver#6893

Signed-off-by: Tom Paulus <tpaulus@cloudflare.com>
@CLAassistant
Copy link

CLAassistant commented Jan 6, 2026

CLA assistant check
All committers have signed the CLA.

@francislavoie francislavoie added this to the v2.11.0 milestone Jan 6, 2026
@francislavoie francislavoie added the bug 🐞 Something isn't working label Jan 6, 2026
@francislavoie francislavoie merged commit 6a57142 into caddyserver:master Jan 6, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug 🐞 Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants