Update generateDirectDownloadUrl to use static https://api.truckwash.io host and simplify URL generation logic
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user