From 9f938ea8eb2c1e47eba592d80f3e37e725cfab05 Mon Sep 17 00:00:00 2001 From: core Date: Mon, 31 Jul 2023 01:34:17 -0400 Subject: [PATCH] tfcli: hotfix: fix host blocking --- tfcli/Cargo.toml | 2 +- tfcli/src/host.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tfcli/Cargo.toml b/tfcli/Cargo.toml index 02e501e..008828e 100644 --- a/tfcli/Cargo.toml +++ b/tfcli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tfcli" -version = "0.1.4" +version = "0.1.5" edition = "2021" description = "Command-line client for managing trifid-api" license = "GPL-3.0-or-later" diff --git a/tfcli/src/host.rs b/tfcli/src/host.rs index a4f6d90..8a1ebca 100644 --- a/tfcli/src/host.rs +++ b/tfcli/src/host.rs @@ -405,7 +405,7 @@ pub async fn block_host(id: String, server: Url) -> Result<(), Box> { let token = format!("{} {}", session_token, auth_token); - let res = client.post(server.join(&format!("/v1/hosts/{}/block", id))?).bearer_auth(token).send().await?; + let res = client.post(server.join(&format!("/v1/hosts/{}/block", id))?).header("Content-Length", "0").bearer_auth(token).send().await?; if res.status().is_success() { println!("Host blocked. To unblock it, re-enroll the host.");