Skip to content

Commit

Permalink
Added fix so we only slice the key if we have a KEYSPACE_PREFIX
Browse files Browse the repository at this point in the history
  • Loading branch information
tkmcmaster committed Dec 21, 2023
1 parent 3ef4b36 commit d45f146
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion common/src/s3file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export class PpaasS3File implements S3File {
.map(async (s3File: S3Object) => {
// find the part after the s3Folder. We may have a prefix added to us so it may not be at the beginning
// If s3Folder is part of a folder we need to split on the / not on the folder name
const key: string = s3File.Key!.startsWith(KEYSPACE_PREFIX) ? s3File.Key!.slice(KEYSPACE_PREFIX.length) : s3File.Key!;
const key: string = KEYSPACE_PREFIX && s3File.Key!.startsWith(KEYSPACE_PREFIX) ? s3File.Key!.slice(KEYSPACE_PREFIX.length) : s3File.Key!;
const s3KeySplit = key.split("/");
const realFolder = s3KeySplit.slice(0, -1).join("/");
const filename = s3KeySplit[s3KeySplit.length - 1];
Expand Down

0 comments on commit d45f146

Please sign in to comment.