Skip to content

Commit

Permalink
fix(application-system-api): Copy object on upload fix (#16883)
Browse files Browse the repository at this point in the history
* bucket change and debug error log

* removing log and adding post processing to presignedposts

* chore: nx format:write update dirty files

* replacing more buckets

* adding bucket to env

* undoing bucket changes

* newline change

* undo frontend change

* double check its the right character at the end

---------

Co-authored-by: andes-it <[email protected]>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored and jonnigs committed Nov 26, 2024
1 parent 5a7a4a4 commit 5855f73
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion libs/nest/aws/src/lib/s3.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,12 @@ export class S3Service {
params: PresignedPostOptions,
): Promise<PresignedPost> {
try {
return await createPresignedPost(this.s3Client, params)
// The S3 Aws sdk v3 returns a trailing forward slash
const post = await createPresignedPost(this.s3Client, params)
if (post.url.endsWith('/')) {
post.url = post.url.slice(0, -1)
}
return post
} catch (error) {
this.logger.error(
`An error occurred while trying to create a presigned post for file: ${params.Key} in bucket: ${params.Bucket}`,
Expand Down

0 comments on commit 5855f73

Please sign in to comment.