Add support for alternative download domain #3

Merged
Francesco Siddi merged 4 commits from cdn-support-for-downloads into develop 2024-05-30 09:22:56 +02:00
Showing only changes of commit 374ef34f90 - Show all commits

View File

@ -284,14 +284,15 @@ class BuildsRenderer {
stringContains($_SERVER['REQUEST_URI'], "bpy")) ? stringContains($_SERVER['REQUEST_URI'], "bpy")) ?
"/download/daily" : strtok($_SERVER['REQUEST_URI'], '?'); "/download/daily" : strtok($_SERVER['REQUEST_URI'], '?');
$env_id = getEnvId();
$protocol = "https"; $protocol = "https";
$host_id = getHostId();
$env_id = getEnvId();
Review

The environment ID depends on getHostId(). If the host ID is somehow to depend on configuration, it needs to be consistently handled in getHostId()

The environment ID depends on `getHostId()`. If the host ID is somehow to depend on configuration, it needs to be consistently handled in `getHostId()`
if (! in_array($env_id, array("UATEST", "PROD"))) { if (! in_array($env_id, array("UATEST", "PROD"))) {
$protocol = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http"); $protocol = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http");
} }
$host_id = getHostId();
$uri = $protocol . "://$host_id" . "$request_uri"; $uri = $protocol . "://$host_id" . "$request_uri";
$escaped_file_name = htmlspecialchars($build->file_name); $escaped_file_name = htmlspecialchars($build->file_name);