mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-08-31 04:34:27 +00:00
Fix PUT with empty POST data returning inode/x-empty instead of image/png
This commit is contained in:
+3
-1
@@ -544,7 +544,9 @@ class Curl
|
||||
if (empty($this->options[CURLOPT_INFILE]) && empty($this->options[CURLOPT_INFILESIZE])) {
|
||||
$this->setHeader('Content-Length', strlen($put_data));
|
||||
}
|
||||
$this->setOpt(CURLOPT_POSTFIELDS, $put_data);
|
||||
if (!empty($put_data)) {
|
||||
$this->setOpt(CURLOPT_POSTFIELDS, $put_data);
|
||||
}
|
||||
return $this->exec();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user