host: expose harness state and actions over the world API
This commit is contained in:
@@ -46,13 +46,10 @@ impl WasiHttpHooks for Hooks {
|
||||
{
|
||||
let bytes = body.collect().await?.to_bytes();
|
||||
let request = Request::from_parts(parts, bytes);
|
||||
if request.method() == http::Method::POST && request.uri().path() == "/cargo" {
|
||||
return Ok((
|
||||
crate::api::stream(&router, request),
|
||||
Box::new(async { Ok(()) }) as Io,
|
||||
));
|
||||
}
|
||||
return Ok(response(crate::api::handle(&router, caller, request).await));
|
||||
return Ok((
|
||||
crate::api::dispatch(&router, caller, request).await,
|
||||
Box::new(async { Ok(()) }) as Io,
|
||||
));
|
||||
}
|
||||
if !matches!(parts.uri.scheme_str(), Some("http" | "https")) {
|
||||
while let Some(frame) = body.frame().await {
|
||||
|
||||
Reference in New Issue
Block a user