@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.
package/dist/index.mjs CHANGED
@@ -8711,6 +8711,15 @@ function readConfiguredPort(value) {
8711
8711
  function buildBootstrapUrl(protocol, address, port) {
8712
8712
  return `${protocol}://${address}:${port}`;
8713
8713
  }
8714
+ function readExplicitPortFromOrigin(raw) {
8715
+ const match = raw.match(
8716
+ /^[a-z]+:\/\/(?:\[[^\]]+\]|[^\/?#:]+):(\d+)(?:\/)?$/i
8717
+ );
8718
+ if (!match?.[1]) {
8719
+ return void 0;
8720
+ }
8721
+ return readConfiguredPort(match[1]);
8722
+ }
8714
8723
  function resolveInjectedBootstrapUrl(injectedGlobalKey) {
8715
8724
  if (typeof globalThis === "undefined") {
8716
8725
  return void 0;
@@ -8800,7 +8809,8 @@ function resolveBootstrapEndpoint(options) {
8800
8809
  "Bootstrap URL must be an origin without a path component."
8801
8810
  );
8802
8811
  }
8803
- const port2 = parsed2.port ? readConfiguredPort(parsed2.port) : fallbackPort;
8812
+ const explicitPort = readExplicitPortFromOrigin(raw);
8813
+ const port2 = explicitPort ?? (parsed2.port ? readConfiguredPort(parsed2.port) : fallbackPort);
8804
8814
  if (!port2) {
8805
8815
  throw new Error(
8806
8816
  "Bootstrap URL must include a port or CADENZA_DB_PORT must be provided."