From 70427d9db9470d1104cbcff752e6f1103ad8c4d5 Mon Sep 17 00:00:00 2001 From: Curt Tudor Date: Fri, 17 Jan 2025 10:11:22 -0700 Subject: [PATCH] fix: Correct sub-domain Service-routing issue (#239) --- src/ZitiFirstStrategy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ZitiFirstStrategy.ts b/src/ZitiFirstStrategy.ts index 5107a74..f3179a4 100644 --- a/src/ZitiFirstStrategy.ts +++ b/src/ZitiFirstStrategy.ts @@ -611,7 +611,7 @@ class ZitiFirstStrategy extends CacheFirst /* NetworkFirst */ { // Don't muck with URL only because top-level domain of target matches the top-level domain of the load-balancer. // Only do that if the entire hostname matches, or else sub-domains represented by different Services will be routed // to the wrong place. - if (!isEqual(newUrl.hostname, this._zitiBrowzerServiceWorkerGlobalScope._zitiConfig.browzer.bootstrapper.self.host)) { + if (isEqual(newUrl.hostname, this._zitiBrowzerServiceWorkerGlobalScope._zitiConfig.browzer.bootstrapper.self.host)) { newUrl.hostname = this._zitiBrowzerServiceWorkerGlobalScope._zitiConfig.browzer.bootstrapper.target.service; newUrl.port = this._zitiBrowzerServiceWorkerGlobalScope._zitiConfig.browzer.bootstrapper.target.port;