openclaw-channel-dmwork 0.5.5 → 0.5.6

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/api-fetch.ts +9 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openclaw-channel-dmwork",
3
- "version": "0.5.5",
3
+ "version": "0.5.6",
4
4
  "description": "DMWork channel plugin for OpenClaw via WuKongIM WebSocket",
5
5
  "main": "index.ts",
6
6
  "type": "module",
package/src/api-fetch.ts CHANGED
@@ -548,7 +548,15 @@ export async function uploadFileToCOS(params: {
548
548
  let url: string;
549
549
  if (params.cdnBaseUrl) {
550
550
  const base = params.cdnBaseUrl.replace(/\/+$/, "");
551
- url = `${base}/${params.key}`;
551
+ // Re-encode each path segment: COS keys may contain percent-encoded
552
+ // characters (e.g. Chinese filenames). Without double-encoding, the
553
+ // IM client decodes the URL once and requests a key with raw UTF-8
554
+ // characters that doesn't exist in COS (NoSuchKey / 404).
555
+ const reEncodedKey = params.key
556
+ .split("/")
557
+ .map((seg) => encodeURIComponent(seg))
558
+ .join("/");
559
+ url = `${base}/${reEncodedKey}`;
552
560
  } else {
553
561
  url = data.Location ? `https://${data.Location}` : "";
554
562
  }