Update generateDirectDownloadUrl to use static https://api.truckwash.io host and simplify URL generation logic

This commit is contained in:
Jeppe Bundgaard
2026-03-11 11:25:53 +01:00
parent 44a0146c9f
commit 6713a67eb5
@@ -80,10 +80,9 @@ class attachment_store implements minio_uploads_i
public function generateDirectDownloadUrl(string $fileName): string
{
$host = $_SERVER['HTTP_HOST'] ?? 'api.truckwash.dk';
$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || ($_SERVER['SERVER_PORT'] ?? 0) == 443 ? "https://" : "http://";
$host = 'https://api.truckwash.io';
// Generate a direct download URL for the given file name
return $protocol . $host . '/files/' . $fileName;
return $host . '/files/' . $fileName;
}
}