diff --git a/content/spin/v2/http-outbound.md b/content/spin/v2/http-outbound.md index a07359bfa..ec9a81238 100644 --- a/content/spin/v2/http-outbound.md +++ b/content/spin/v2/http-outbound.md @@ -168,6 +168,13 @@ allowed_outbound_hosts = [ "https://random-data-api.fermyon.app", "http://api.ex 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. +You can use a wildcard to allow requests to any subdomain of a domain: + +```toml +[component.example] +allowed_outbound_hosts = [ "https://*.example.com" ] +``` + 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! ### Making HTTP Requests Within an Application