From 6897238d3bd1a3e22be9a81127852543f6d4b75f Mon Sep 17 00:00:00 2001 From: a Date: Fri, 26 Jul 2024 15:52:39 -0500 Subject: [PATCH] noot --- src/docs/markdown/extending-caddy/placeholders.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/docs/markdown/extending-caddy/placeholders.md b/src/docs/markdown/extending-caddy/placeholders.md index 6b163fe..d3d6282 100644 --- a/src/docs/markdown/extending-caddy/placeholders.md +++ b/src/docs/markdown/extending-caddy/placeholders.md @@ -86,7 +86,9 @@ Some users may immediately notice that this means it is impossible to use the `{ #### Parse the raw placeholder value in your unmarshaler -Placeholders should be parsed as their raw values when parsing the Cazddyfile, just like any other string value. +Placeholders are not evaluated at Caddyfile parse time, and should be preserved for later use. They are used as their raw string values. + +In other words, parsing a placeholder is no different from parsing any other string. ```go func (g *Gizmo) UnmarshalCaddyfile(d *caddyfile.Dispenser) error { @@ -98,7 +100,7 @@ func (g *Gizmo) UnmarshalCaddyfile(d *caddyfile.Dispenser) error { } ``` -#### Resolve the placeholder during Match or Serve +#### Evaluate the placeholder during Match or Serve In order to now correctly read our `g.Name` placeholder in a plugin matcher or middleware, we must extract the replacer from the context and use that replacer on our saved placeholder string.