[tests] more strictness

This commit is contained in:
Shish
2024-01-20 19:47:26 +00:00
parent b60c3fe362
commit 8b797a9a31
28 changed files with 143 additions and 115 deletions

View File

@ -352,8 +352,10 @@ class OuroborosAPI extends Extension
// Transload from source
$meta['file'] = tempnam(sys_get_temp_dir(), 'shimmie_transload_' . $config->get_string(UploadConfig::TRANSLOAD_ENGINE));
$meta['filename'] = basename($post->file_url);
if (!fetch_url($post->file_url, $meta['file'])) {
$this->sendResponse(500, 'Transloading failed');
try {
fetch_url($post->file_url, $meta['file']);
} catch (FetchException $e) {
$this->sendResponse(500, "Transloading failed: $e");
return;
}
$meta['hash'] = md5_file($meta['file']);