Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

regex for ip address+port

Andras Bacsai6e738a2fc07a
diff --git a/apps/designer/app/shared/router-utils/build-params.ts b/apps/designer/app/shared/router-utils/build-params.ts
index aa74b2b456..4b6f7c5efb 100644
--- a/apps/designer/app/shared/router-utils/build-params.ts
+++ b/apps/designer/app/shared/router-utils/build-params.ts
@@ -47,7 +47,11 @@ export const getBuildOrigin = (
return `http://${host.split(".").pop()}`;
}
// If we're not on localhost, we're probably using ip address - useful for remote development
- if (host.split(".").length === 4) {
+ if (
+ /(\b(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)(?::\d{0,4})?\b)/.test(
+ host
+ )
+ ) {
return `http://${host}`;
}
}