Skip to content
Snippets Groups Projects
Commit eab4ea06 authored by Markus Guenther's avatar Markus Guenther
Browse files

[BUGFIX] Fix diff fetching from https gitlab

This issue is related to the Buzz Client that does not support https
for getContents.

See https://github.com/kriswallsmith/Buzz/issues/193 to get more information.
We use curl instead of the default client now.
parent 098fbc1f
No related branches found
No related tags found
No related merge requests found
......@@ -27,6 +27,7 @@ namespace SGalinski;
******************************************************************************/
use Buzz\Browser;
use Buzz\Client\Curl;
use Buzz\Exception\ClientException;
use Gitlab\Api\Projects;
use Gitlab\Client;
......@@ -203,7 +204,8 @@ class Webhook {
$browser = $this->getAuthenticatedBrowser();
try {
self::$diffCache[$commit['id']] = $browser->get($diffUrl)->getContent();
$content = $browser->get($diffUrl)->getContent();
self::$diffCache[$commit['id']] = $content;
} catch (ClientException $e) {
error_log('Buzz ClientException : Unable to get diff data');
}
......@@ -278,6 +280,7 @@ class Webhook {
$authToken = $this->settings['Configuration']['Gitlab']['authToken'];
$authentication = new AuthListener($authToken, Client::AUTH_HTTP_TOKEN);
$browser = new Browser();
$browser->setClient(new Curl());
$browser->addListener($authentication);
return $browser;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment