Explorar o código

Use CURLOPT_NOBODY when doing HEAD request.

Miku AuahDark %!s(int64=2) %!d(string=hai) anos
pai
achega
d9afbc7cc3
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      src/generic/CurlClient.cpp

+ 3 - 0
src/generic/CurlClient.cpp

@@ -178,6 +178,9 @@ HTTPSClient::Reply CurlClient::request(const HTTPSClient::Request &req)
 			newHeaders["Content-Type"] = "application/x-www-form-urlencoded";
 	}
 
+	if (method == "HEAD")
+		curl.easy_setopt(handle, CURLOPT_NOBODY, 1L);
+
 	// Curl doesn't copy memory, keep the strings around
 	std::vector<std::string> lines;
 	for (auto &header : newHeaders)