hotfix: 0-length POST request on enrollment
This commit is contained in:
parent
47fd5b2d93
commit
e7828df6ea
|
@ -3633,7 +3633,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "trifid-api"
|
name = "trifid-api"
|
||||||
version = "0.1.1"
|
version = "0.1.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"actix-cors",
|
"actix-cors",
|
||||||
"actix-request-identifier",
|
"actix-request-identifier",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "tfcli"
|
name = "tfcli"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "Command-line client for managing trifid-api"
|
description = "Command-line client for managing trifid-api"
|
||||||
license = "GPL-3.0-or-later"
|
license = "GPL-3.0-or-later"
|
||||||
|
@ -19,4 +19,4 @@ tokio = { version = "1", features = ["full"] }
|
||||||
dirs = "5.0.1"
|
dirs = "5.0.1"
|
||||||
qr2term = "0.3.1"
|
qr2term = "0.3.1"
|
||||||
ipnet = "2.7.2"
|
ipnet = "2.7.2"
|
||||||
serde_json = "1.0.96"
|
serde_json = "1.0.96"
|
||||||
|
|
|
@ -375,7 +375,7 @@ pub async fn enroll_host(id: String, server: Url) -> Result<(), Box<dyn Error>>
|
||||||
|
|
||||||
let token = format!("{} {}", session_token, auth_token);
|
let token = format!("{} {}", session_token, auth_token);
|
||||||
|
|
||||||
let res = client.post(server.join(&format!("/v1/hosts/{}/enrollment-code", id))?).bearer_auth(token).send().await?;
|
let res = client.post(server.join(&format!("/v1/hosts/{}/enrollment-code", id))?).header("content-length", 0).bearer_auth(token).send().await?;
|
||||||
|
|
||||||
if res.status().is_success() {
|
if res.status().is_success() {
|
||||||
let resp: EnrollmentResponse = res.json().await?;
|
let resp: EnrollmentResponse = res.json().await?;
|
||||||
|
@ -637,4 +637,4 @@ pub async fn unset_override(id: String, key: String, server: Url) -> Result<(),
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue