Skip to content

Commit 867d95c

Browse files
authored
Merge pull request #1231 from itowlson/subdomaim-wildcards-and-pretty-wild-they-are-too
Subdomain wildcards
2 parents 1a5f0e9 + 92e4880 commit 867d95c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

content/spin/v2/http-outbound.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,13 @@ allowed_outbound_hosts = [ "https://random-data-api.fermyon.app", "http://api.ex
168168

169169
The Wasm module can make HTTP requests _only_ to the specified hosts. If a port is specified, the module can make requests only to that port; otherwise, the module can make requests only on the default port for the scheme. Requests to other hosts (or ports) will fail with an error.
170170

171+
You can use a wildcard to allow requests to any subdomain of a domain:
172+
173+
```toml
174+
[component.example]
175+
allowed_outbound_hosts = [ "https://*.example.com" ]
176+
```
177+
171178
For development-time convenience, you can also pass the string `"https://*:*"` in the `allowed_outbound_hosts` collection. This allows the Wasm module to make HTTP requests to _any_ host and on any port. However, once you've determined which hosts your code needs, you should remove this string and list the hosts instead. Other Spin implementations may restrict host access and disallow components that ask to connect to anything and everything!
172179

173180
### Making HTTP Requests Within an Application

0 commit comments

Comments
 (0)