@budibase/backend-core 2.13.31 → 2.13.32

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.js CHANGED
@@ -6229,9 +6229,16 @@ var getTenantIDFromCtx = (ctx, opts) => {
6229
6229
  }
6230
6230
  }
6231
6231
  if (isAllowed("subdomain" /* SUBDOMAIN */)) {
6232
- const platformHost = new URL(getPlatformURL()).host.split(":")[0];
6232
+ let platformHost;
6233
+ try {
6234
+ platformHost = new URL(getPlatformURL()).host.split(":")[0];
6235
+ } catch (err) {
6236
+ if (err.code !== "ERR_INVALID_URL") {
6237
+ throw err;
6238
+ }
6239
+ }
6233
6240
  const requestHost = ctx.host;
6234
- if (requestHost.includes(platformHost)) {
6241
+ if (platformHost && requestHost.includes(platformHost)) {
6235
6242
  const tenantId = requestHost.substring(
6236
6243
  0,
6237
6244
  requestHost.indexOf(`.${platformHost}`)