update client

This commit is contained in:
Chirag Aggarwal
2025-08-12 16:24:01 +05:30
parent f8afbbbf3c
commit 0e636f67be
+2 -7
View File
@@ -216,23 +216,18 @@ class Client
return $len;
});
// Special handling for HEAD requests
if ($method === self::METHOD_HEAD) {
curl_setopt($ch, CURLOPT_NOBODY, true); // This is crucial for HEAD requests
curl_setopt($ch, CURLOPT_HEADER, false); // We handle headers via HEADERFUNCTION
curl_setopt($ch, CURLOPT_HEADER, false);
} else {
curl_setopt($ch, CURLOPT_NOBODY, false);
}
// Only set POST fields for non-GET and non-HEAD requests
if ($method != self::METHOD_GET && $method != self::METHOD_HEAD) {
curl_setopt($ch, CURLOPT_POSTFIELDS, $query);
}
if ($method != self::METHOD_GET) {
curl_setopt($ch, CURLOPT_POSTFIELDS, $query);
}
// Allow self-signed certificates
if ($this->selfSigned) {
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);