@@ -27,10 +27,8 @@ pub enum HandlerType {
2727pub const WASI_HTTP_EXPORT_2023_10_18 : & str =
"wasi:http/[email protected] " ; 2828/// The `incoming-handler` export for `wasi:http` version rc-2023-11-10
2929pub const WASI_HTTP_EXPORT_2023_11_10 : & str =
"wasi:http/[email protected] " ; 30- /// The `incoming-handler` export for `wasi:http` version 0.2.0
31- pub const WASI_HTTP_EXPORT_0_2_0 : & str =
"wasi:http/[email protected] " ; 32- /// The `incoming-handler` export for `wasi:http` version 0.2.1
33- pub const WASI_HTTP_EXPORT_0_2_1 : & str =
"wasi:http/[email protected] " ; 30+ /// The `incoming-handler` export prefix for all `wasi:http` 0.2 versions
31+ pub const WASI_HTTP_EXPORT_0_2 : & str =
"wasi:http/[email protected] " ; 3432/// The `inbound-http` export for `fermyon:spin`
3533pub const SPIN_HTTP_EXPORT : & str = "fermyon:spin/inbound-http" ;
3634
@@ -58,8 +56,8 @@ impl HandlerType {
5856 match name {
5957 WASI_HTTP_EXPORT_2023_10_18 => set ( HandlerType :: Wasi2023_10_18 ) ?,
6058 WASI_HTTP_EXPORT_2023_11_10 => set ( HandlerType :: Wasi2023_11_10 ) ?,
61- WASI_HTTP_EXPORT_0_2_0 | WASI_HTTP_EXPORT_0_2_1 => set ( HandlerType :: Wasi0_2 ) ?,
6259 SPIN_HTTP_EXPORT => set ( HandlerType :: Spin ) ?,
60+ name if name. starts_with ( WASI_HTTP_EXPORT_0_2 ) => set ( HandlerType :: Wasi0_2 ) ?,
6361 _ => { }
6462 }
6563 }
@@ -69,8 +67,7 @@ impl HandlerType {
6967 "Expected component to export one of \
7068 `{WASI_HTTP_EXPORT_2023_10_18}`, \
7169 `{WASI_HTTP_EXPORT_2023_11_10}`, \
72- `{WASI_HTTP_EXPORT_0_2_0}`, \
73- `{WASI_HTTP_EXPORT_0_2_1}`, \
70+ `{WASI_HTTP_EXPORT_0_2}.*`, \
7471 or `{SPIN_HTTP_EXPORT}` but it exported none of those"
7572 )
7673 } )
0 commit comments