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.
- package/package.json +1 -1
- package/src/api-fetch.ts +9 -1
package/package.json
CHANGED
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
|
-
|
|
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
|
}
|