소스 검색

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)