@builder.io/sdk-svelte 5.2.4 → 5.2.5
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.
- package/lib/browser/constants/sdk-version.d.ts +1 -1
- package/lib/browser/constants/sdk-version.js +1 -1
- package/lib/browser/functions/is-from-trusted-host.js +9 -3
- package/lib/edge/constants/sdk-version.d.ts +1 -1
- package/lib/edge/constants/sdk-version.js +1 -1
- package/lib/edge/functions/is-from-trusted-host.js +9 -3
- package/lib/node/constants/sdk-version.d.ts +1 -1
- package/lib/node/constants/sdk-version.js +1 -1
- package/lib/node/functions/is-from-trusted-host.js +9 -3
- package/package.json +1 -1
- package/src/constants/sdk-version.ts +1 -1
- package/src/functions/is-from-trusted-host.ts +8 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "5.2.
|
|
1
|
+
export declare const SDK_VERSION = "5.2.5";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "5.2.
|
|
1
|
+
export const SDK_VERSION = "5.2.5";
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
const DEFAULT_TRUSTED_HOSTS = ['*.beta.builder.io', 'beta.builder.io', 'builder.io', 'localhost', 'qa.builder.io'];
|
|
2
2
|
export function isFromTrustedHost(trustedHosts, e) {
|
|
3
|
-
|
|
3
|
+
let url;
|
|
4
|
+
try {
|
|
5
|
+
url = new URL(e.origin);
|
|
6
|
+
}
|
|
7
|
+
catch {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
if (url.protocol !== 'http:' && url.protocol !== 'https:') {
|
|
4
11
|
return false;
|
|
5
12
|
}
|
|
6
|
-
|
|
7
|
-
return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex(trustedHost => trustedHost.startsWith('*.') ? hostname.endsWith(trustedHost.slice(1)) : trustedHost === hostname) > -1;
|
|
13
|
+
return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex(trustedHost => trustedHost.startsWith('*.') ? url.hostname.endsWith(trustedHost.slice(1)) : trustedHost === url.hostname) > -1;
|
|
8
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "5.2.
|
|
1
|
+
export declare const SDK_VERSION = "5.2.5";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "5.2.
|
|
1
|
+
export const SDK_VERSION = "5.2.5";
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
const DEFAULT_TRUSTED_HOSTS = ['*.beta.builder.io', 'beta.builder.io', 'builder.io', 'localhost', 'qa.builder.io'];
|
|
2
2
|
export function isFromTrustedHost(trustedHosts, e) {
|
|
3
|
-
|
|
3
|
+
let url;
|
|
4
|
+
try {
|
|
5
|
+
url = new URL(e.origin);
|
|
6
|
+
}
|
|
7
|
+
catch {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
if (url.protocol !== 'http:' && url.protocol !== 'https:') {
|
|
4
11
|
return false;
|
|
5
12
|
}
|
|
6
|
-
|
|
7
|
-
return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex(trustedHost => trustedHost.startsWith('*.') ? hostname.endsWith(trustedHost.slice(1)) : trustedHost === hostname) > -1;
|
|
13
|
+
return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex(trustedHost => trustedHost.startsWith('*.') ? url.hostname.endsWith(trustedHost.slice(1)) : trustedHost === url.hostname) > -1;
|
|
8
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "5.2.
|
|
1
|
+
export declare const SDK_VERSION = "5.2.5";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "5.2.
|
|
1
|
+
export const SDK_VERSION = "5.2.5";
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
const DEFAULT_TRUSTED_HOSTS = ['*.beta.builder.io', 'beta.builder.io', 'builder.io', 'localhost', 'qa.builder.io'];
|
|
2
2
|
export function isFromTrustedHost(trustedHosts, e) {
|
|
3
|
-
|
|
3
|
+
let url;
|
|
4
|
+
try {
|
|
5
|
+
url = new URL(e.origin);
|
|
6
|
+
}
|
|
7
|
+
catch {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
if (url.protocol !== 'http:' && url.protocol !== 'https:') {
|
|
4
11
|
return false;
|
|
5
12
|
}
|
|
6
|
-
|
|
7
|
-
return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex(trustedHost => trustedHost.startsWith('*.') ? hostname.endsWith(trustedHost.slice(1)) : trustedHost === hostname) > -1;
|
|
13
|
+
return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex(trustedHost => trustedHost.startsWith('*.') ? url.hostname.endsWith(trustedHost.slice(1)) : trustedHost === url.hostname) > -1;
|
|
8
14
|
}
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "5.2.
|
|
1
|
+
export const SDK_VERSION = "5.2.5"
|
|
@@ -2,10 +2,14 @@ const DEFAULT_TRUSTED_HOSTS = ['*.beta.builder.io', 'beta.builder.io', 'builder.
|
|
|
2
2
|
export function isFromTrustedHost(trustedHosts: string[] | undefined, e: {
|
|
3
3
|
origin: string;
|
|
4
4
|
}): boolean {
|
|
5
|
-
|
|
5
|
+
let url: URL;
|
|
6
|
+
try {
|
|
7
|
+
url = new URL(e.origin);
|
|
8
|
+
} catch {
|
|
6
9
|
return false;
|
|
7
10
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
if (url.protocol !== 'http:' && url.protocol !== 'https:') {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex(trustedHost => trustedHost.startsWith('*.') ? url.hostname.endsWith(trustedHost.slice(1)) : trustedHost === url.hostname) > -1;
|
|
11
15
|
}
|