Thanks to visit codestin.com
Credit goes to github.com

Skip to content

core: support default values in placeholders - #7967

Open
larrasket wants to merge 1 commit into
caddyserver:masterfrom
larrasket:placeholder-default-values
Open

core: support default values in placeholders#7967
larrasket wants to merge 1 commit into
caddyserver:masterfrom
larrasket:placeholder-default-values

Conversation

@larrasket

Copy link
Copy Markdown
Contributor

Placeholders may specify a default value after a colon, {placeholder:default}, mirroring the syntax already used for environment variable defaults in the Caddyfile. The default is used when the placeholder is recognized but evaluates to an empty string. Keys whose name before the colon is not a recognized placeholder (including JSON such as {"a": "b"}) are left unchanged.

Closes #1793

Assistance Disclosure

Claude Sonnet 5 generated the changes and the commit message, with verification and direction done by myself

Placeholders may now specify a default value after a colon,
{placeholder:default}, mirroring the syntax already used for environment
variable defaults in the Caddyfile. The default is used when the
placeholder is recognized but evaluates to an empty string. Keys whose
name before the colon is not a recognized placeholder (including JSON
such as {"a": "b"}) are left unchanged.

Closes caddyserver#1793
@larrasket
larrasket force-pushed the placeholder-default-values branch from b18ce75 to 3fe3ac4 Compare September 2, 2026 10:43
@steadytao steadytao added the feature ⚙️ New feature or request label Sep 2, 2026
@steadytao steadytao added this to the v2.11.5 milestone Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature ⚙️ New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature-Request: Placeholder with default value

2 participants