From f34775031981a5866b6b565c050971cda8550260 Mon Sep 17 00:00:00 2001 From: dachus Date: Tue, 12 Dec 2023 11:39:01 -0600 Subject: [PATCH 1/2] fix --- src/http/client.rs | 60 ++++++++++++++++++++++------------------------ 1 file changed, 29 insertions(+), 31 deletions(-) diff --git a/src/http/client.rs b/src/http/client.rs index bcd85d53..e9fd0296 100644 --- a/src/http/client.rs +++ b/src/http/client.rs @@ -136,38 +136,36 @@ async fn handle_message( match client.execute(request).await { Ok(response) => { - if expects_response.is_some() { - let _ = send_to_loop - .send(KernelMessage { - id, - source: Address { - node: our.to_string(), - process: ProcessId::new(Some("http_client"), "sys", "uqbar"), + let _ = send_to_loop + .send(KernelMessage { + id, + source: Address { + node: our.to_string(), + process: ProcessId::new(Some("http_client"), "sys", "uqbar"), + }, + target, + rsvp: None, + message: Message::Response(( + Response { + inherit: false, + ipc: serde_json::to_vec::>( + &Ok(HttpResponse { + status: response.status().as_u16(), + headers: serialize_headers(response.headers()), + }), + ) + .unwrap(), + metadata: None, }, - target, - rsvp: None, - message: Message::Response(( - Response { - inherit: false, - ipc: serde_json::to_vec::>( - &Ok(HttpResponse { - status: response.status().as_u16(), - headers: serialize_headers(response.headers()), - }), - ) - .unwrap(), - metadata: None, - }, - None, - )), - payload: Some(Payload { - mime: None, - bytes: response.bytes().await.unwrap_or_default().to_vec(), - }), - signed_capabilities: None, - }) - .await; - } + None, + )), + payload: Some(Payload { + mime: None, + bytes: response.bytes().await.unwrap_or_default().to_vec(), + }), + signed_capabilities: None, + }) + .await; } Err(e) => { make_error_message( From 53d657e324858340a6920c17da7b88a7d79f49cb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 12 Dec 2023 17:39:43 +0000 Subject: [PATCH 2/2] Format Rust code using rustfmt --- src/http/client.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/http/client.rs b/src/http/client.rs index e9fd0296..45813755 100644 --- a/src/http/client.rs +++ b/src/http/client.rs @@ -148,12 +148,12 @@ async fn handle_message( message: Message::Response(( Response { inherit: false, - ipc: serde_json::to_vec::>( - &Ok(HttpResponse { + ipc: serde_json::to_vec::>(&Ok( + HttpResponse { status: response.status().as_u16(), headers: serialize_headers(response.headers()), - }), - ) + }, + )) .unwrap(), metadata: None, },