Skip to content

πŸ“¨ The ultimate agentic social media scheduling tool πŸ€–

feat: is it ip

Nevo David2c90cdd03b69
diff --git a/libraries/helpers/src/subdomain/subdomain.management.ts b/libraries/helpers/src/subdomain/subdomain.management.ts
index 8f74c9881..2d391f398 100644
--- a/libraries/helpers/src/subdomain/subdomain.management.ts
+++ b/libraries/helpers/src/subdomain/subdomain.management.ts
@@ -1,6 +1,11 @@
import {allTwoLevelSubdomain} from "./all.two.level.subdomain";
export function removeSubdomain(domain: string) {
+ // Check if the domain is an IP address with optional port
+ const ipRegex = /^(https?:\/\/)?(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(:\d+)?$/;
+ if (ipRegex.test(domain)) {
+ return domain; // Return the original domain if it's an IP address
+ }
// Split the domain into its parts
const parts = domain.split('.');