Skip to content

Commit d9afbc7

Browse files
committed
Use CURLOPT_NOBODY when doing HEAD request.
1 parent 4f474d1 commit d9afbc7

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/generic/CurlClient.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,9 @@ HTTPSClient::Reply CurlClient::request(const HTTPSClient::Request &req)
178178
newHeaders["Content-Type"] = "application/x-www-form-urlencoded";
179179
}
180180

181+
if (method == "HEAD")
182+
curl.easy_setopt(handle, CURLOPT_NOBODY, 1L);
183+
181184
// Curl doesn't copy memory, keep the strings around
182185
std::vector<std::string> lines;
183186
for (auto &header : newHeaders)

0 commit comments

Comments
 (0)