clawkeep 0.2.0 → 0.2.1
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/core/transport.js +9 -1
package/package.json
CHANGED
package/src/core/transport.js
CHANGED
|
@@ -166,7 +166,15 @@ class CloudTransport extends BackupTransport {
|
|
|
166
166
|
accessKey: creds.access_key_id,
|
|
167
167
|
secretKey: creds.secret_access_key,
|
|
168
168
|
});
|
|
169
|
-
|
|
169
|
+
// API returns prefix like "workspaces/ws_xxx/" which is the R2 base path.
|
|
170
|
+
// SyncManager already prepends workspaceId to all paths (e.g. "ws_xxx/manifest.enc"),
|
|
171
|
+
// so we use the API prefix minus the trailing workspaceId to avoid doubling.
|
|
172
|
+
let prefix = creds.prefix || '';
|
|
173
|
+
const wsSuffix = this.workspace + '/';
|
|
174
|
+
if (prefix.endsWith(wsSuffix)) {
|
|
175
|
+
prefix = prefix.slice(0, -wsSuffix.length);
|
|
176
|
+
}
|
|
177
|
+
this._inner = new S3Transport(s3, prefix);
|
|
170
178
|
const expiresAt = creds.expires_at || data.expires_at;
|
|
171
179
|
this._credsExpiry = expiresAt
|
|
172
180
|
? new Date(expiresAt).getTime()
|