Skip to content

httpcaddyfile: error on duplicate named_routes - #7800

Merged
francislavoie merged 2 commits into
caddyserver:masterfrom
vijayvenkatj:master
Jun 4, 2026
Merged

francislavoie merged 2 commits into
caddyserver:masterfrom
vijayvenkatj:master

Conversation

@vijayvenkatj

Copy link
Copy Markdown
Contributor

Fixes issue #7798

Validate named route names before inserting them into the named route map.

This prevents later definitions from overwriting existing named routes and returns an error when a route name is defined more than once.

Assistance Disclosure

No AI was used for this code.

Fixes issue #7798

Validate named route names before inserting them into the
named route map.

This prevents later definitions from overwriting existing
named routes and returns an error when a route name is
defined more than once.
@francislavoie

francislavoie commented Jun 4, 2026 •

Copy link
Copy Markdown
Member

Can we add a test that covers this? .caddyfiletest files can assert errors as well https://github.com/caddyserver/caddy/tree/master/caddytest/integration/caddyfile_adapt

@vijayvenkatj

Copy link
Copy Markdown
Contributor Author

Can we add a test that covers this? .caddyfiletest files can assert errors as well https://github.com/caddyserver/caddy/tree/master/caddytest/integration/caddyfile_adapt

Sure, I'll add that.

@francislavoie francislavoie added the bug 🐞 Something isn't working label Jun 4, 2026
@francislavoie francislavoie added this to the v2.11.5 milestone Jun 4, 2026
@francislavoie francislavoie changed the title fix: error on duplicate named_routes httpcaddyfile: error on duplicate named_routes Jun 4, 2026
@francislavoie
francislavoie merged commit 3b7bde8 into caddyserver:master Jun 4, 2026
24 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.

2 participants