@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.
@@ -6325,6 +6325,15 @@ function readConfiguredPort(value) {
6325
6325
  function buildBootstrapUrl(protocol, address, port) {
6326
6326
  return `${protocol}://${address}:${port}`;
6327
6327
  }
6328
+ function readExplicitPortFromOrigin(raw) {
6329
+ const match = raw.match(
6330
+ /^[a-z]+:\/\/(?:\[[^\]]+\]|[^\/?#:]+):(\d+)(?:\/)?$/i
6331
+ );
6332
+ if (!match?.[1]) {
6333
+ return void 0;
6334
+ }
6335
+ return readConfiguredPort(match[1]);
6336
+ }
6328
6337
  function resolveInjectedBootstrapUrl(injectedGlobalKey) {
6329
6338
  if (typeof globalThis === "undefined") {
6330
6339
  return void 0;
@@ -6414,7 +6423,8 @@ function resolveBootstrapEndpoint(options) {
6414
6423
  "Bootstrap URL must be an origin without a path component."
6415
6424
  );
6416
6425
  }
6417
- const port2 = parsed2.port ? readConfiguredPort(parsed2.port) : fallbackPort;
6426
+ const explicitPort = readExplicitPortFromOrigin(raw);
6427
+ const port2 = explicitPort ?? (parsed2.port ? readConfiguredPort(parsed2.port) : fallbackPort);
6418
6428
  if (!port2) {
6419
6429
  throw new Error(
6420
6430
  "Bootstrap URL must include a port or CADENZA_DB_PORT must be provided."