Skip to content

Commit 63f708f

Browse files
authored
fix(client): add Content-Length: 0 for bodyless POST/PUT/PATCH requests (#52)
1 parent c46e99e commit 63f708f

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

crates/ans-client/src/client.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,8 @@ impl AnsClient {
360360
req = req
361361
.header(header::CONTENT_TYPE, "application/json")
362362
.json(body);
363+
} else if method == "POST" || method == "PUT" || method == "PATCH" {
364+
req = req.header(header::CONTENT_LENGTH, "0");
363365
}
364366
self.send(req).await
365367
}

0 commit comments

Comments
 (0)