Skip to content

Commit 7c12ffe

Browse files
fix(feature): build url shortener feature url with trailing slash
initUrlShortener() appended the branch directly to public_urls without a trailing slash, so DEPLOYER_CONFIG_FEATURE_URL (TYPO3_BASEURL) became "https://host/BRANCH". Consumer projects derive the site base and string- concatenated values (e.g. %env(TYPO3_BASEURL)%sitemap.xml) from it, which broke absolute URLs/breadcrumbs and caused 504 hangs. Build the URL slash-robust so it always ends with "/" regardless of whether public_urls is configured with or without a trailing slash: rtrim($publicUrl, '/') . '/' . $feature . '/'. NOTE: feature .env files are generated only once ("once generated" feature_templates). Existing feature instances must re-init (re-run feature:setup / re-generate .env) for the corrected URL to take effect.
1 parent 86b89d4 commit 7c12ffe

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

deployer/feature/task/url_shortener.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@
44

55
tasK('feature:urlshortener', function () {
66

7-
if (!input()->getOption('feature')) return;
8-
if (!isUrlShortener()) return;
7+
if (!input()->getOption('feature')) {
8+
return;
9+
}
10+
if (!isUrlShortener()) {
11+
return;
12+
}
913

1014
$symlinkDir = get('deploy_path') . "/current/" . get('web_path');
1115

@@ -35,15 +39,17 @@ function isUrlShortener(): bool
3539
*/
3640
function initUrlShortener(?string $feature = null): void
3741
{
38-
if (!isUrlShortener()) return;
42+
if (!isUrlShortener()) {
43+
return;
44+
}
3945

4046
debug('Adjust host configuration because of url shortener function');
4147
set('deploy_path_url_shortener', get('deploy_path'));
4248
set('deploy_path', get('deploy_path') . '/' . get('feature_url_shortener_path') . $feature);
4349

4450
$publicUrls = [];
4551
foreach (get('public_urls') as $publicUrl) {
46-
$publicUrls[] = $publicUrl . $feature;
52+
$publicUrls[] = rtrim($publicUrl, '/') . '/' . $feature . '/';
4753
}
4854
set('public_urls', $publicUrls);
4955
}

0 commit comments

Comments
 (0)