Skip to content

caddyconfig: Register nested named-route invokes transitively#7898

Open
SillyZir wants to merge 1 commit into
caddyserver:masterfrom
SillyZir:auto-fix-6435
Open

caddyconfig: Register nested named-route invokes transitively#7898
SillyZir wants to merge 1 commit into
caddyserver:masterfrom
SillyZir:auto-fix-6435

Conversation

@SillyZir

@SillyZir SillyZir commented Jul 21, 2026

Copy link
Copy Markdown

Fixes #6435.

Record which named routes each named route invokes during extraction and transitively attach those routes (with cycle protection) when populating a server's named_routes, so nested invoke targets are no longer dropped.

Previously, invoke foo inside a named route &(bar) was never registered into the server's named_routes, so invoking bar at runtime failed when it reached the nested invoke foo. The adapter now records, per named route, which named routes it invokes, and when a server references a named route it attaches that route plus everything it transitively invokes (breadth-first, with already-attached routes skipped so cycles terminate). The existing "cannot invoke named route which was not defined" error is preserved for undefined targets at any depth.

Files: caddyconfig/httpcaddyfile/httptype.go

Assistance Disclosure
This patch was developed with AI assistance. It was reviewed and tested before submission (affected package tests pass), and is submitted from a human-owned account that takes responsibility for the change.

@CLAassistant

CLAassistant commented Jul 21, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@SillyZir
SillyZir marked this pull request as ready for review July 21, 2026 02:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nested named route invocation undetected

2 participants