tfcli: hotfix: fix host blocking

This commit is contained in:
core 2023-07-31 01:34:17 -04:00
parent 2e214ba8fe
commit 9f938ea8eb
Signed by: core
GPG Key ID: FDBF740DADDCEECF
2 changed files with 2 additions and 2 deletions

View File

@ -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"

View File

@ -405,7 +405,7 @@ pub async fn block_host(id: String, server: Url) -> Result<(), Box<dyn Error>> {
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.");