1
0
Fork 0
mirror of https://codeberg.org/demostf/api.git synced 2026-06-04 02:14:06 +02:00
This commit is contained in:
Robin Appelman 2019-01-23 18:56:44 +01:00
commit c29fe61ad1
24 changed files with 1242 additions and 50 deletions

View file

@ -33,8 +33,8 @@ class RawParser {
$response = $client->post($this->parserUrl, [
'body' => stream_for($url),
'headers' => [
'Content-Type' => 'application/octet-stream'
]
'Content-Type' => 'application/octet-stream',
],
]);
$result = json_decode($response->getBody()->getContents(), true);
$this->tempController->unregister($key);
@ -45,7 +45,7 @@ class RawParser {
}
} catch (RequestException $e) {
$this->tempController->unregister($key);
if (strpos($e->getMessage(), 'cURL error 52') !== false) {
if (false !== strpos($e->getMessage(), 'cURL error 52')) {
throw new \Exception('Failed to parse demo, can\'t reach demo parser');
}
throw new \Exception('Failed to parse demo, ' . $e->getMessage() . ' ' . $url);