Skip to content

Commit

Permalink
Relax wasi 0.2 constraint
Browse files Browse the repository at this point in the history
Signed-off-by: Darwin Boersma <[email protected]>
  • Loading branch information
ogghead committed Nov 26, 2024
1 parent 6c0c68f commit aa2a8cf
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions crates/http/src/trigger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@ pub enum HandlerType {
pub const WASI_HTTP_EXPORT_2023_10_18: &str = "wasi:http/[email protected]";
/// The `incoming-handler` export for `wasi:http` version rc-2023-11-10
pub const WASI_HTTP_EXPORT_2023_11_10: &str = "wasi:http/[email protected]";
/// The `incoming-handler` export for `wasi:http` version 0.2.0
pub const WASI_HTTP_EXPORT_0_2_0: &str = "wasi:http/[email protected]";
/// The `incoming-handler` export for `wasi:http` version 0.2.1
pub const WASI_HTTP_EXPORT_0_2_1: &str = "wasi:http/[email protected]";
/// The `incoming-handler` export prefix for all `wasi:http` 0.2 versions
pub const WASI_HTTP_EXPORT_0_2_PREFIX: &str = "wasi:http/[email protected]";
/// The `inbound-http` export for `fermyon:spin`
pub const SPIN_HTTP_EXPORT: &str = "fermyon:spin/inbound-http";

Expand Down Expand Up @@ -58,8 +56,8 @@ impl HandlerType {
match name {
WASI_HTTP_EXPORT_2023_10_18 => set(HandlerType::Wasi2023_10_18)?,
WASI_HTTP_EXPORT_2023_11_10 => set(HandlerType::Wasi2023_11_10)?,
WASI_HTTP_EXPORT_0_2_0 | WASI_HTTP_EXPORT_0_2_1 => set(HandlerType::Wasi0_2)?,
SPIN_HTTP_EXPORT => set(HandlerType::Spin)?,
name if name.starts_with(WASI_HTTP_EXPORT_0_2_PREFIX) => set(HandlerType::Wasi0_2)?,
_ => {}
}
}
Expand All @@ -69,8 +67,7 @@ impl HandlerType {
"Expected component to export one of \
`{WASI_HTTP_EXPORT_2023_10_18}`, \
`{WASI_HTTP_EXPORT_2023_11_10}`, \
`{WASI_HTTP_EXPORT_0_2_0}`, \
`{WASI_HTTP_EXPORT_0_2_1}`, \
`{WASI_HTTP_EXPORT_0_2_PREFIX}.*`, \
or `{SPIN_HTTP_EXPORT}` but it exported none of those"
)
})
Expand Down

0 comments on commit aa2a8cf

Please sign in to comment.