Skip to content

Commit 76cc4cb

Browse files
author
Edwin Westerhoud
committed
Updated Tinify client.
1 parent 017b39d commit 76cc4cb

2 files changed

Lines changed: 23 additions & 20 deletions

File tree

composer.lock

Lines changed: 19 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/vendor/tinify/Tinify/Client.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,12 @@ function request($method, $url, $body = NULL, $header = array()) {
4444

4545
$url = strtolower(substr($url, 0, 6)) == "https:" ? $url : self::API_ENDPOINT . $url;
4646
curl_setopt($request, CURLOPT_URL, $url);
47-
curl_setopt($request, CURLOPT_HTTPHEADER, $header);
4847
curl_setopt($request, CURLOPT_CUSTOMREQUEST, strtoupper($method));
4948

49+
if (count($header) > 0) {
50+
curl_setopt($request, CURLOPT_HTTPHEADER, $header);
51+
}
52+
5053
if ($body) {
5154
curl_setopt($request, CURLOPT_POSTFIELDS, $body);
5255
}

0 commit comments

Comments
 (0)