mirror of
https://github.com/caddyserver/website.git
synced 2025-06-15 10:44:44 -04:00
noot
This commit is contained in:
parent
ecf57209ec
commit
86ffe92c33
1 changed files with 2 additions and 2 deletions
|
@ -90,7 +90,7 @@ You should not process placeholders when ummarshaling your Caddyfile. Instead, u
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
|
|
||||||
In this example, we are using a newly constructed replacer to process placeholders. It has access to placeholders such as `{env.HOST}`, but NOT `{http.request.uri}`
|
In this example, we are using a newly constructed replacer to process placeholders. It only has has access to global placeholders such as `{env.HOST}`.
|
||||||
|
|
||||||
```go
|
```go
|
||||||
func (g *Gizmo) Provision(ctx caddy.Context) error {
|
func (g *Gizmo) Provision(ctx caddy.Context) error {
|
||||||
|
@ -100,7 +100,7 @@ func (g *Gizmo) Provision(ctx caddy.Context) error {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Here, we extract a replacer out of the `context.Context` inside the `*http.Request`. This replacer has access to http placeholers, such as `{http.request.uri}`
|
Here, we extract a replacer out of the `context.Context` inside the `*http.Request`. This replacer has access to both global placeholders, but also http placeholders, such as `{http.request.uri}`
|
||||||
|
|
||||||
```go
|
```go
|
||||||
func (g *Gizmo) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error {
|
func (g *Gizmo) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue