chiark / gitweb /
Switch to reqwest in the client (minor pre-reorg)
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 1 Feb 2025 12:43:17 +0000 (12:43 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 1 Feb 2025 20:14:58 +0000 (20:14 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
client/client.rs

index 5b25ea77043c4320bb5ce9cc67d0becb78149c42..e3a57164fe13bb2589ce087ee8c84332e3d2f6fa 100644 (file)
@@ -149,11 +149,15 @@ fn submit_request<'r, 'c:'r, C:Hcc>(
     )
   );
 
-  let req = hyper::Request::post(&c.ic.url)
-    .header("Content-Type", r#"multipart/form-data; boundary="b""#)
-    .header("Content-Length", body_len)
-    .body(body)
-    .context("construct request")?;
+  let req = {
+    let ctype = r#"multipart/form-data; boundary="b""#;
+    let req = hyper::Request::post(&c.ic.url)
+      .header("Content-Type", ctype)
+      .header("Content-Length", body_len)
+      .body(body)
+      .context("construct request")?;
+    req
+  };
 
   let resp = c.hclient.request(req);
   let fut = Box::pin(async move {