@@ -27,10 +27,8 @@ pub enum HandlerType {
27
27
pub const WASI_HTTP_EXPORT_2023_10_18 : & str =
"wasi:http/[email protected] " ;
28
28
/// The `incoming-handler` export for `wasi:http` version rc-2023-11-10
29
29
pub 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_PREFIX : & str =
"wasi:http/[email protected] " ;
34
32
/// The `inbound-http` export for `fermyon:spin`
35
33
pub const SPIN_HTTP_EXPORT : & str = "fermyon:spin/inbound-http" ;
36
34
@@ -58,8 +56,8 @@ impl HandlerType {
58
56
match name {
59
57
WASI_HTTP_EXPORT_2023_10_18 => set ( HandlerType :: Wasi2023_10_18 ) ?,
60
58
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 ) ?,
62
59
SPIN_HTTP_EXPORT => set ( HandlerType :: Spin ) ?,
60
+ name if name. starts_with ( WASI_HTTP_EXPORT_0_2_PREFIX ) => set ( HandlerType :: Wasi0_2 ) ?,
63
61
_ => { }
64
62
}
65
63
}
@@ -69,8 +67,7 @@ impl HandlerType {
69
67
"Expected component to export one of \
70
68
`{WASI_HTTP_EXPORT_2023_10_18}`, \
71
69
`{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_PREFIX}.*`, \
74
71
or `{SPIN_HTTP_EXPORT}` but it exported none of those"
75
72
)
76
73
} )
0 commit comments