@cadenza.io/service 2.17.7 → 2.17.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6376,6 +6376,15 @@ function readConfiguredPort(value) {
6376
6376
  function buildBootstrapUrl(protocol, address, port) {
6377
6377
  return `${protocol}://${address}:${port}`;
6378
6378
  }
6379
+ function readExplicitPortFromOrigin(raw) {
6380
+ const match = raw.match(
6381
+ /^[a-z]+:\/\/(?:\[[^\]]+\]|[^\/?#:]+):(\d+)(?:\/)?$/i
6382
+ );
6383
+ if (!match?.[1]) {
6384
+ return void 0;
6385
+ }
6386
+ return readConfiguredPort(match[1]);
6387
+ }
6379
6388
  function resolveInjectedBootstrapUrl(injectedGlobalKey) {
6380
6389
  if (typeof globalThis === "undefined") {
6381
6390
  return void 0;
@@ -6465,7 +6474,8 @@ function resolveBootstrapEndpoint(options) {
6465
6474
  "Bootstrap URL must be an origin without a path component."
6466
6475
  );
6467
6476
  }
6468
- const port2 = parsed2.port ? readConfiguredPort(parsed2.port) : fallbackPort;
6477
+ const explicitPort = readExplicitPortFromOrigin(raw);
6478
+ const port2 = explicitPort ?? (parsed2.port ? readConfiguredPort(parsed2.port) : fallbackPort);
6469
6479
  if (!port2) {
6470
6480
  throw new Error(
6471
6481
  "Bootstrap URL must include a port or CADENZA_DB_PORT must be provided."