Skip to content

Commit

Permalink
Merge pull request #1231 from itowlson/subdomaim-wildcards-and-pretty…
Browse files Browse the repository at this point in the history
…-wild-they-are-too

Subdomain wildcards
  • Loading branch information
itowlson authored Apr 3, 2024
2 parents 1a5f0e9 + 92e4880 commit 867d95c
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 867d95c

Please sign in to comment.