サンプル
github.com/caddyserver/caddy/v2 2.11.4: Demonstrate how caddyhttp request variables replacer resolves context variables and treats unset http.vars placeholders as known.
検証済みサンプル — golang github.com/caddyserver/caddy/v2 2.11.4: Demonstrate how caddyhttp request variables replacer resolves context variables and treats unset…
sha256:6ed0bc875895a1c84783d4e701fbffa96fc9a6031c79d62f31dd95df642afe3d
このネットワークが提供するのは一つだけです。ビルドされるサンプル。サンドボックスで実行し、署名済みの受領証を保管します。等級はつけず、何も保証しません — 同じコードがあなたの環境でビルドされるかは測定していません。
合格した契約受領証を提出した異なる署名鍵の数です。1 なら作者だけ、2 以上なら他の誰かもビルドしています。鍵は自己生成で背後に登録された身元がないため、数えているのは人ではなく鍵です。
MIT-0
実行証拠
宣言された環境と署名済みの実行を分けてあります。このサンプルが何をどこで実行したかをそのまま確認できます。
- 証拠の基準
- 署名済みコントラクト合格
- 検証レシート
- 2
- ビルドした署名鍵
- 1
宣言された環境
go linux x64 go go go
検証実行環境
| 環境 | コントラクト | ステージ | 実行日 |
|---|---|---|---|
| go 1.26 · linux alpine/x64 · docker ed25519:d91480838ac982c9 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · golang@1 |
2026-08-17 |
| go 1.26 · linux alpine/x64 · docker ed25519:2175b912ea1c23b1 | FAIL | compile:SKIPPED · contract:FAIL · load:SKIPPED · resolve:PASS CONTAINER_RUN · golang@1 |
2026-08-18 |
ケース
HOW- ゴール
- Demonstrate how caddyhttp request variables replacer resolves context variables and treats unset http.vars placeholders as known.
- シンボル
-
- caddyhttp.RequestVarsReplacer
- 環境
- go
- 作成日
- 2026-08-17T22:09:51Z
コントラクト
- The caddyhttp replacer recognizes all {http.vars.*} placeholders as known and replaces unset variables with the fallback string in ReplaceKnown rather than leaving them unreplaced.
- Context variables set via caddyhttp.SetVar are dynamically resolved by {http.vars.<name>} placeholders in the replacer.
- Setting a variable to nil via caddyhttp.SetVar deletes it from the request context variable map.
- The replacer resolves standard HTTP request properties such as method, path, query parameters, and headers alongside custom context variables.
- VarsMatcher evaluates placeholders in rule values against stored context variables without expanding placeholder syntax inside the stored values.
ファイル
- NOTES.md
- csx.json
- go.mod
- go.sum
- request_vars_replacer_test.go