Skip to content

Commit 9352e3a

Browse files
authored
Fix: S3 connection does not work correctly in Windows
1 parent 870ecaf commit 9352e3a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

scripts/server-client.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1263,7 +1263,7 @@ var client = function(path) {
12631263

12641264
let s3 = await this.connectS3();
12651265

1266-
let base = getPathWithoutShare(path);
1266+
let base = posixPath(getPathWithoutShare(path));
12671267
let nextContinuationToken = false;
12681268

12691269
for(let page = 0; page < 10; page++) // Get max 10000 files
@@ -1284,7 +1284,7 @@ var client = function(path) {
12841284
for(let i = 0, len = entries.Contents.length; i < len; i++)
12851285
{
12861286
let entry = entries.Contents[i];
1287-
let name = fileManager.removePathPart(entry.Key, base).replace(/\/$/, '');
1287+
let name = fileManager.removePathPart(entry.Key, base).replace(/\/$/, '').replace(/^\//, '');
12881288

12891289
let folder = /\/$/.test(entry.Key);
12901290

@@ -1301,7 +1301,7 @@ var client = function(path) {
13011301
for(let i = 0, len = entries.CommonPrefixes.length; i < len; i++)
13021302
{
13031303
let entry = entries.CommonPrefixes[i];
1304-
let name = fileManager.removePathPart(entry.Prefix, base).replace(/\/$/, '');
1304+
let name = fileManager.removePathPart(entry.Prefix, base).replace(/\/$/, '').replace(/^\//, '');
13051305

13061306
if(name && !/\/./.test(name))
13071307
{
@@ -1370,7 +1370,7 @@ var client = function(path) {
13701370

13711371
let params = {
13721372
Bucket: s3.bucket,
1373-
Key: getPathWithoutShare(path),
1373+
Key: posixPath(getPathWithoutShare(path)),
13741374
};
13751375

13761376
let response = await s3.client.send(new s3c.Get(params));

0 commit comments

Comments
 (0)