@mdbase-dev/connect-protocol 0.1.0-beta.166 → 0.1.0-beta.171

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.
@@ -70,3 +70,8 @@ export declare function validateTypePackProvision(value: unknown, path?: string)
70
70
  /** RFC 8252 §7.3 native exception: canonical literal IPv4 only, any valid port.
71
71
  * This classifies transport; the registered manifest, consent and pairing grant authority. */
72
72
  export declare function isNativeLoopbackOrigin(value: unknown): value is string;
73
+ /** An exact loopback HTTP web origin (`localhost`, `127.0.0.1` or `[::1]`, any
74
+ * port): where an application runs while it is being developed. A remote page
75
+ * cannot give itself this origin, but any program on the computer can serve it,
76
+ * so it identifies no publisher. */
77
+ export declare function isLoopbackHttpOrigin(value: unknown): value is string;
package/dist/manifest.js CHANGED
@@ -620,6 +620,21 @@ function isNativeLoopbackUrl(value) {
620
620
  const origin = /^http:\/\/[^/?#]+/.exec(value)?.[0];
621
621
  return isNativeLoopbackOrigin(origin);
622
622
  }
623
+ /** An exact loopback HTTP web origin (`localhost`, `127.0.0.1` or `[::1]`, any
624
+ * port): where an application runs while it is being developed. A remote page
625
+ * cannot give itself this origin, but any program on the computer can serve it,
626
+ * so it identifies no publisher. */
627
+ export function isLoopbackHttpOrigin(value) {
628
+ if (typeof value !== "string")
629
+ return false;
630
+ try {
631
+ const url = new URL(value);
632
+ return url.protocol === "http:" && isLoopback(url.hostname) && url.origin === value;
633
+ }
634
+ catch {
635
+ return false;
636
+ }
637
+ }
623
638
  function secureOrAllowedLocal(url, allowLocal) {
624
639
  return url.protocol === "https:"
625
640
  || (allowLocal && url.protocol === "http:" && isLoopback(url.hostname));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mdbase-dev/connect-protocol",
3
- "version": "0.1.0-beta.166",
3
+ "version": "0.1.0-beta.171",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -47,6 +47,6 @@
47
47
  "typecheck": "tsc -p tsconfig.json --noEmit"
48
48
  },
49
49
  "mdbaseRelease": {
50
- "commit": "fde3cf93e2b8fc37786f21fcc52fa3ca7e4b8c0d"
50
+ "commit": "2436ba4ac8a9aef326030c1c608d1682f3fd1590"
51
51
  }
52
52
  }