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