Skip to content

Commit 251cd72

Browse files
add debug info
1 parent bdec9f9 commit 251cd72

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/php/libsdk/SDK/FileOps.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,17 +139,21 @@ protected function download(string $url, string $dest_fn = NULL) : ?string
139139
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
140140
curl_setopt($ch, CURLOPT_USERAGENT, Config::getSdkUserAgentName());
141141
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
142+
curl_setopt($ch, CURLOPT_VERBOSE, 1);
142143

143144
$token = getenv('API_TOKEN');
144145
if (!empty($token)) {
145146
echo "**** define authorization header ! ****\n";
146-
var_dump(curl_setopt($ch, CURLOPT_HTTPHEADER, ['x-custom-header: top1','Authorization: Bearer '.$token]));
147+
var_dump(curl_setopt($ch, CURLOPT_HTTPHEADER, ['Accept: text/plain','X-custom-header: top1','Authorization: Bearer '.$token]));
147148
}
149+
echo "curl_error=". curl_error($ch) ."\n";
150+
148151

149152
// workaround for <https://github.com/microsoft/php-sdk-binary-tools/issues/69>
150153
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
151154

152155
$ret = curl_exec($ch);
156+
var_dump($ret);
153157

154158
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
155159
if (false === $ret || 200 !== $code) {

0 commit comments

Comments
 (0)