Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relax wasi 0.2 constraint #2935

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading