-
Notifications
You must be signed in to change notification settings - Fork 257
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Darwin Boersma <[email protected]>
- Loading branch information
Showing
1 changed file
with
4 additions
and
7 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 |
---|---|---|
|
@@ -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: &str = "wasi:http/[email protected]"; | ||
/// The `inbound-http` export for `fermyon:spin` | ||
pub const SPIN_HTTP_EXPORT: &str = "fermyon:spin/inbound-http"; | ||
|
||
|
@@ -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) => set(HandlerType::Wasi0_2)?, | ||
_ => {} | ||
} | ||
} | ||
|
@@ -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}.*`, \ | ||
or `{SPIN_HTTP_EXPORT}` but it exported none of those" | ||
) | ||
}) | ||
|