Skip to content

Commit

Permalink
Subdomain wildcards
Browse files Browse the repository at this point in the history
Signed-off-by: itowlson <[email protected]>
  • Loading branch information
itowlson committed Mar 26, 2024
1 parent 4bf6839 commit 92e4880
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions content/spin/v2/http-outbound.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 92e4880

Please sign in to comment.