dash-button-web 0.0.21 → 0.0.22

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.
@@ -3934,9 +3934,23 @@ class ConfigService {
3934
3934
  }
3935
3935
  const configService = ConfigService.getInstance();
3936
3936
 
3937
+ // const getRootDomain = (hostOrUrl: string): string => {
3938
+ // // Ensure we can parse it with URL
3939
+ // const url = hostOrUrl.startsWith("http") ? new URL(hostOrUrl) : new URL(`https://${hostOrUrl}`);
3940
+ // const hostname = url.hostname;
3941
+ // const port = url.port ? `:${url.port}` : "";
3942
+ // const parts = hostname.split(".");
3943
+ // // localhost → return with port
3944
+ // if (hostname === "localhost") return hostname + port;
3945
+ // // sslip.io → keep last 3 parts
3946
+ // if (hostname.endsWith(".sslip.io")) return parts.slice(-5).join(".") + port;
3947
+ // // Normal domains → remove first label
3948
+ // return parts.slice(1).join(".") + port;
3949
+ // };
3937
3950
  const getRootDomain = (hostOrUrl) => {
3938
- // Ensure we can parse it with URL
3939
- const url = hostOrUrl.startsWith("http") ? new URL(hostOrUrl) : new URL(`https://${hostOrUrl}`);
3951
+ const url = hostOrUrl.startsWith("http")
3952
+ ? new URL(hostOrUrl)
3953
+ : new URL(`https://${hostOrUrl}`);
3940
3954
  const hostname = url.hostname;
3941
3955
  const port = url.port ? `:${url.port}` : "";
3942
3956
  const parts = hostname.split(".");
@@ -3946,8 +3960,8 @@ const getRootDomain = (hostOrUrl) => {
3946
3960
  // sslip.io → keep last 3 parts
3947
3961
  if (hostname.endsWith(".sslip.io"))
3948
3962
  return parts.slice(-5).join(".") + port;
3949
- // Normal domains → remove first label
3950
- return parts.slice(1).join(".") + port;
3963
+ // Keep full hostname
3964
+ return hostname + port;
3951
3965
  };
3952
3966
  const getUrlProtocol = (url, defaultProtocol = "https://") => {
3953
3967
  if (!url)