From b049297082d8ed9ed65c4d52a11c9ed986125828 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Sun, 3 Apr 2022 17:49:41 +0200 Subject: [PATCH] fix: Infinite loop on www domains --- src/lib/haproxy/configuration.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/haproxy/configuration.ts b/src/lib/haproxy/configuration.ts index 120e2d4cd..a7f223e0e 100644 --- a/src/lib/haproxy/configuration.ts +++ b/src/lib/haproxy/configuration.ts @@ -175,7 +175,7 @@ export async function configureHAProxy() { isRunning, isHttps, redirectValue, - redirectTo: isWWW ? domain : 'www.' + domain, + redirectTo: isWWW ? domain.replace('www.', '') : 'www.' + domain, updatedAt: updatedAt.getTime() }); } @@ -199,7 +199,7 @@ export async function configureHAProxy() { isRunning, isHttps, redirectValue, - redirectTo: isWWW ? previewDomain : 'www.' + previewDomain, + redirectTo: isWWW ? previewDomain.replace('www.', '') : 'www.' + previewDomain, updatedAt: updatedAt.getTime() }); } @@ -242,7 +242,7 @@ export async function configureHAProxy() { isRunning, isHttps, redirectValue, - redirectTo: isWWW ? domain : 'www.' + domain, + redirectTo: isWWW ? domain.replace('www.', '') : 'www.' + domain, updatedAt: updatedAt.getTime() }); } @@ -262,7 +262,7 @@ export async function configureHAProxy() { domain, isHttps, redirectValue, - redirectTo: isWWW ? domain : 'www.' + domain + redirectTo: isWWW ? domain.replace('www.', '') : 'www.' + domain }); } const output = mustache.render(template, data);