Skip to content

Commit 0217bea

Browse files
ericgregoryricochet
authored andcommitted
fix(templates): declare allowedHosts for http-client outbound demo
On wash 2.5.x, a project with no `workload:` block resolves to an empty ResolvedWorkload and the runtime is fail-closed on empty `allowedHosts`, so the http-client template's demo flow fails with HttpRequestDenied out of the box. Declare `httpbin.org` (the default target) in `workload.allowedHosts` and add a README note pointing users at the list so they can add their own overrides. Signed-off-by: Eric Gregory <eric@cosmonic.com>
1 parent 9a31045 commit 0217bea

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

templates/http-client/.wash/config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,10 @@ new:
44
build:
55
command: npm run build
66
component_path: dist/http_client.wasm
7+
8+
# Outbound HTTP is gated by the host runtime. Hosts listed here are
9+
# allowed for this component; add new hosts before targeting them via
10+
# the `?url=URL` override.
11+
workload:
12+
allowedHosts:
13+
- httpbin.org

templates/http-client/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ npm run dev
4848

4949
All endpoints support the `?url=URL` query parameter to specify a custom target URL.
5050

51+
> **Configuring outbound hosts.** Outbound HTTP is gated by the host runtime; hosts listed in `workload.allowedHosts` in [.wash/config.yaml](.wash/config.yaml) are allowed. The template ships with `httpbin.org` to match the default demo endpoints; add any additional hosts you plan to hit via `?url=URL`.
52+
5153
## Features
5254

5355
### 1. Multiple HTTP Methods

0 commit comments

Comments
 (0)