feature:添加http head请求的支持 (#4321)

添加http head请求的支持
This commit is contained in:
肖锋
2025-06-30 20:46:18 +08:00
committed by GitHub
parent 48fd240817
commit fd34b5526b
2 changed files with 28 additions and 1 deletions

View File

@@ -264,7 +264,7 @@ ssize_t HttpClient::onRecvHeader(const char *data, size_t len) {
_total_body_size = -1;
}
if (_total_body_size == 0) {
if (_total_body_size == 0 || _method == "HEAD") {
// 后续没content本次http请求结束 [AUTO-TRANSLATED:8532172f]
// There is no content afterwards, this http request ends
onResponseCompleted_l(SockException(Err_success, "The request is successful but has no body"));