Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

Commit

Permalink
fix pascal casing for AllowedHttpHosts
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Fisher <matt.fisher@fermyon.com>
  • Loading branch information
bacongobbler committed Aug 22, 2022
1 parent 75c4eb7 commit 29c3dfa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class RevisionComponent
public string? Files { get; set; }

/// Optional list of HTTP hosts the component is allowed to connect.
public List<string>? AllowedHTTPHosts { get; set; }
public List<string>? AllowedHttpHosts { get; set; }

/// Environment variables to be mapped inside the Wasm module at runtime.
public Dictionary<string, string>? Environment { get; set; }
Expand Down
29 changes: 8 additions & 21 deletions tests/Infrastructure.UnitTests/Services/BindleServiceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,14 @@ public class BindleServiceTests
[Fact]
public void SpinTomlShouldBeParsable()
{
var parcel = @"
[trigger]
type = 'http'
base = '/'
var parcels = new List<string>{
"[trigger]\ntype = 'http'\nbase = '/'\n\n[config.object]\ndefault = 'teapot'\nrequired = false\nsecret = false\n\n[[component]]\nsource = 'c3b7bfec9f12cf0e9e763fcaaa8140ef099577cf7c84130c9c9d66e85cf6d416'\nid = 'spin_config_tinygo'\n\n[component.trigger]\nroute = '/...'\n\n[component.config]\nmessage = '''I'm a {{object}}'''\n",
"[trigger]\ntype = 'http'\nbase = '/'\n\n[[component]]\nsource = 'f2a469f6dddea6e53ac554d41eecad98358db280cfde5e44ea89f770682e9b4f'\nid = 'rust-outbound-http'\nallowedHttpHosts = ['https://some-random-api.ml']\n\n[component.trigger]\nroute = '/outbound'\n\n[[component]]\nsource = 'f2a469f6dddea6e53ac554d41eecad98358db280cfde5e44ea89f770682e9b4f'\nid = 'rust-outbound-http-wildcard'\nallowedHttpHosts = ['insecure:allow-all']\n\n[component.trigger]\nroute = '/wildcard'\n"
};

[config.object]
default = 'teapot'
required = false
secret = false
[[component]]
source = 'c3b7bfec9f12cf0e9e763fcaaa8140ef099577cf7c84130c9c9d66e85cf6d416'
id = 'spin_config_tinygo'
[component.trigger]
route = '/...'
[component.config]
message = '''I'm a {{object}}'''
";

var spinToml = BindleService.ParseSpinToml(parcel);
foreach (var parcel in parcels)
{
BindleService.ParseSpinToml(parcel);
}
}
}

0 comments on commit 29c3dfa

Please sign in to comment.