@graphql-tools/url-loader 7.17.16 → 7.17.17-rc-20230407153012-56a9d2d0
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/cjs/index.js +3 -3
- package/esm/index.js +3 -3
- package/package.json +1 -1
package/cjs/index.js
CHANGED
|
@@ -30,11 +30,11 @@ var SubscriptionProtocol;
|
|
|
30
30
|
*/
|
|
31
31
|
SubscriptionProtocol["GRAPHQL_SSE"] = "GRAPHQL_SSE";
|
|
32
32
|
})(SubscriptionProtocol = exports.SubscriptionProtocol || (exports.SubscriptionProtocol = {}));
|
|
33
|
+
const acceptableProtocols = ['http:', 'https:', 'ws:', 'wss:'];
|
|
33
34
|
function isCompatibleUri(uri) {
|
|
34
35
|
try {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return true;
|
|
36
|
+
const url = new URL(uri);
|
|
37
|
+
return acceptableProtocols.includes(url.protocol);
|
|
38
38
|
}
|
|
39
39
|
catch (_a) {
|
|
40
40
|
return false;
|
package/esm/index.js
CHANGED
|
@@ -26,11 +26,11 @@ export var SubscriptionProtocol;
|
|
|
26
26
|
*/
|
|
27
27
|
SubscriptionProtocol["GRAPHQL_SSE"] = "GRAPHQL_SSE";
|
|
28
28
|
})(SubscriptionProtocol || (SubscriptionProtocol = {}));
|
|
29
|
+
const acceptableProtocols = ['http:', 'https:', 'ws:', 'wss:'];
|
|
29
30
|
function isCompatibleUri(uri) {
|
|
30
31
|
try {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return true;
|
|
32
|
+
const url = new URL(uri);
|
|
33
|
+
return acceptableProtocols.includes(url.protocol);
|
|
34
34
|
}
|
|
35
35
|
catch (_a) {
|
|
36
36
|
return false;
|