-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support
wasi:http/[email protected]
exports (#2853)
This is needed to support the latest experimental .NET SDK, as well as components produced using e.g. `cargo-component` based on WASI 0.2.1 WIT files. Signed-off-by: Joel Dice <[email protected]>
- Loading branch information
Showing
2 changed files
with
42 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -478,6 +478,7 @@ pub enum HandlerType { | |
pub const WASI_HTTP_EXPORT_2023_10_18: &str = "wasi:http/[email protected]"; | ||
pub const WASI_HTTP_EXPORT_2023_11_10: &str = "wasi:http/[email protected]"; | ||
pub const WASI_HTTP_EXPORT_0_2_0: &str = "wasi:http/[email protected]"; | ||
pub const WASI_HTTP_EXPORT_0_2_1: &str = "wasi:http/[email protected]"; | ||
|
||
impl HandlerType { | ||
/// Determine the handler type from the exports of a component | ||
|
@@ -503,7 +504,7 @@ 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 => set(HandlerType::Wasi0_2)?, | ||
WASI_HTTP_EXPORT_0_2_0 | WASI_HTTP_EXPORT_0_2_1 => set(HandlerType::Wasi0_2)?, | ||
"fermyon:spin/inbound-http" => set(HandlerType::Spin)?, | ||
_ => {} | ||
} | ||
|
@@ -515,6 +516,7 @@ impl HandlerType { | |
`{WASI_HTTP_EXPORT_2023_10_18}`, \ | ||
`{WASI_HTTP_EXPORT_2023_11_10}`, \ | ||
`{WASI_HTTP_EXPORT_0_2_0}`, \ | ||
`{WASI_HTTP_EXPORT_0_2_1}`, \ | ||
or `fermyon:spin/inbound-http` but it exported none of those" | ||
) | ||
}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters