@panomc/sdk 1.0.0-dev.56 → 1.0.0-dev.58

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.
@@ -30,11 +30,13 @@ export function checkDomainRedirection() {
30
30
  const apiUrl = new URL(API_URL);
31
31
  const currentUrl = new URL(window.location.href);
32
32
 
33
- if (
34
- currentUrl.hostname !== apiUrl.hostname ||
35
- currentUrl.port !== apiUrl.port ||
36
- currentUrl.protocol !== apiUrl.protocol
37
- ) {
33
+ // Only bounce when the page was opened on the vite port of the SAME machine
34
+ // (localhost:3000 -> localhost:8088). Reaching the Pano dev server through another
35
+ // hostname — a LAN address, ngrok, cloudflared — is legitimate: Pano already proxies vite
36
+ // for that visitor, and API_URL's host means nothing on their machine.
37
+ if (!isSameDevHost(currentUrl.hostname, apiUrl.hostname)) return;
38
+
39
+ if (currentUrl.port !== apiUrl.port || currentUrl.protocol !== apiUrl.protocol) {
38
40
  const basePath = UI_URL || PANEL_URL || SETUP_URL || '/';
39
41
  let pathname = currentUrl.pathname;
40
42
 
@@ -50,6 +52,16 @@ export function checkDomainRedirection() {
50
52
  }
51
53
  }
52
54
 
55
+ function isLoopbackHost(hostname) {
56
+ const h = hostname.toLowerCase();
57
+ return h === 'localhost' || h.endsWith('.localhost') || h === '[::1]' || h.startsWith('127.');
58
+ }
59
+
60
+ function isSameDevHost(a, b) {
61
+ const norm = (h) => (isLoopbackHost(h) ? 'localhost' : h.toLowerCase());
62
+ return norm(a) === norm(b);
63
+ }
64
+
53
65
  export function updateApiUrl(apiUrl) {
54
66
  API_URL = apiUrl;
55
67
  }
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@panomc/sdk",
3
- "version": "1.0.0-dev.56",
3
+ "version": "1.0.0-dev.58",
4
4
  "author": "PanoMC",
5
5
  "repository": {
6
6
  "url": "https://github.com/PanoMC/sdk"
7
7
  },
8
8
  "dependencies": {
9
- "svelte": "5.55.4",
9
+ "svelte": "5.55.9",
10
10
  "tippy.js": "^6.3.7",
11
- "adm-zip": "^0.5.17"
11
+ "adm-zip": "^0.6.1"
12
12
  },
13
13
  "devDependencies": {
14
- "svelte": "5.55.4"
14
+ "svelte": "5.55.9"
15
15
  },
16
16
  "exports": {
17
17
  ".": {