Compare commits

..

3 Commits

Author SHA1 Message Date
Jean-Baptiste Nahan
b9530450e2 try other header 2024-11-13 00:03:24 +01:00
Jean-Baptiste Nahan
c74c3b5b94 add log 2024-11-12 23:12:24 +01:00
Jean-Baptiste Nahan
53afca7edb Add header if API_TOKEN is present 2024-11-12 22:59:25 +01:00

View File

@@ -131,13 +131,19 @@ retry:
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
}
curl_setopt($ch, CURLOPT_HEADER, false);
//curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_USERAGENT, Config::getSdkUserAgentName());
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
$token = getenv('API_TOKEN');
if (!empty($token)) {
echo "**** define authorization header ! ****\n";
curl_setopt($ch, CURLOPT_HTTPHEADER, ['x-custom-header: top1','Authorization: Bearer '.$token]);
}
// workaround for <https://github.com/microsoft/php-sdk-binary-tools/issues/69>
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);