@decentnetwork/beagle 0.1.123 → 0.1.124

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.
@@ -1,4 +1,4 @@
1
- window.__DK_UI_VERSION="0.1.123";
1
+ window.__DK_UI_VERSION="0.1.124";
2
2
  "use strict";
3
3
  (() => {
4
4
  // packages/beagle-ui/dist/beagle-ui.js
@@ -1697,12 +1697,23 @@ ${lines}`, { assistant: { kind: "adopt", rows: fresh } }));
1697
1697
  }, [append, lang, onReloadFriends]);
1698
1698
  return { thread, handle, removeFriends, adoptServicePeers };
1699
1699
  }
1700
+ var REQUEST_AVATAR_HOST = "ens-gateway.beaglechat.workers.dev";
1700
1701
  var MAX_URL = 2048;
1701
1702
  function requestAvatarUrl(r) {
1702
1703
  const u = r && r.avatarUrl;
1703
1704
  if (typeof u !== "string" || !u || u.length > MAX_URL)
1704
1705
  return null;
1705
- return /^https:\/\/[^\s"'<>]+$/i.test(u) ? u : null;
1706
+ let parsed;
1707
+ try {
1708
+ parsed = new URL(u);
1709
+ } catch {
1710
+ return null;
1711
+ }
1712
+ if (parsed.protocol !== "https:" || parsed.host !== REQUEST_AVATAR_HOST)
1713
+ return null;
1714
+ if (parsed.username || parsed.password)
1715
+ return null;
1716
+ return parsed.href;
1706
1717
  }
1707
1718
  function requestPunkId(r) {
1708
1719
  const p = r && r.punkId;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decentnetwork/beagle",
3
- "version": "0.1.123",
3
+ "version": "0.1.124",
4
4
  "description": "Beagle — P2P chat, file transfer and calls for regular users, on the Decent Network. No admin privilege required.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -26,7 +26,7 @@
26
26
  "start": "node dist/cli.js"
27
27
  },
28
28
  "dependencies": {
29
- "@decentnetwork/beagle-ui": "^0.2.34",
29
+ "@decentnetwork/beagle-ui": "^0.2.35",
30
30
  "@decentnetwork/chat-components": "^0.1.3",
31
31
  "@decentnetwork/lan": "^0.1.313",
32
32
  "@decentnetwork/peer": "^0.1.170",