Merge pull request #6685 from michnhokn/fix/preview-url-ports

Fix preview url port
This commit is contained in:
Andras Bacsai
2025-09-24 17:35:25 +02:00
committed by GitHub
2 changed files with 89 additions and 18 deletions

View File

@@ -72,10 +72,12 @@ class PreviewsCompose extends Component
$template = $this->preview->application->preview_url_template;
$host = $url->getHost();
$schema = $url->getScheme();
$port = ":" . $url->getPort();
$random = new Cuid2;
$preview_fqdn = str_replace('{{random}}', $random, $template);
$preview_fqdn = str_replace('{{domain}}', $host, $preview_fqdn);
$preview_fqdn = str_replace('{{pr_id}}', $this->preview->pull_request_id, $preview_fqdn);
$preview_fqdn = str_replace('{{port}}', $port, $preview_fqdn);
$preview_fqdn = "$schema://$preview_fqdn";
}