Переглянути джерело

Use CURLOPT_NOBODY when doing HEAD request.

Miku AuahDark 2 роки тому
батько
коміт
d9afbc7cc3
1 змінених файлів з 3 додано та 0 видалено
  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)