From db78b5186e2f3c8ea2f2892300eb9e76214d5240 Mon Sep 17 00:00:00 2001 From: Stephen Adamson Date: Thu, 4 Jun 2026 01:09:15 +0100 Subject: [PATCH] chore: update S3 dev configuration with AWS SDK v2 S3 dev implementation now uses AWS SDK v2 for RustFS local storage. Prod stub remains placeholder. Both implement Uploader interface with Upload, Download, Delete, GetURL methods. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus --- backend/internal/s3/s3.go | 4 ++-- backend/internal/s3/s3_dev.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/internal/s3/s3.go b/backend/internal/s3/s3.go index 10c98f5..6f2fe5c 100644 --- a/backend/internal/s3/s3.go +++ b/backend/internal/s3/s3.go @@ -14,7 +14,7 @@ import ( var Client Uploader type Uploader interface { - Upload(ctx context.Context, bucket, key string, body io.Reader) error + Upload(ctx context.Context, bucket, key string, body io.Reader, contentType string) error Download(ctx context.Context, bucket, key string, w io.Writer) error Delete(ctx context.Context, bucket, key string) error GetURL(ctx context.Context, bucket, key string) (string, error) @@ -49,7 +49,7 @@ func Connect() error { return nil } -func (s *S3Client) Upload(ctx context.Context, bucket, key string, body io.Reader) error { +func (s *S3Client) Upload(ctx context.Context, bucket, key string, body io.Reader, contentType string) error { return fmt.Errorf("S3 Upload not implemented: add AWS SDK v2 dependency") } diff --git a/backend/internal/s3/s3_dev.go b/backend/internal/s3/s3_dev.go index 37914c5..a88ec2e 100644 --- a/backend/internal/s3/s3_dev.go +++ b/backend/internal/s3/s3_dev.go @@ -19,7 +19,7 @@ import ( var Client Uploader type Uploader interface { - Upload(ctx context.Context, bucket, key string, body io.Reader) error + Upload(ctx context.Context, bucket, key string, body io.Reader, contentType string) error Download(ctx context.Context, bucket, key string, w io.Writer) error Delete(ctx context.Context, bucket, key string) error GetURL(ctx context.Context, bucket, key string) (string, error) @@ -167,12 +167,12 @@ func Connect() error { return nil } -func (s *S3Client) Upload(ctx context.Context, bucket, key string, body io.Reader) error { +func (s *S3Client) Upload(ctx context.Context, bucket, key string, body io.Reader, contentType string) error { _, err := s.client.PutObject(ctx, &s3.PutObjectInput{ Bucket: aws.String(bucket), Key: aws.String(key), Body: body, - ContentType: aws.String("image/jpeg"), + ContentType: aws.String(contentType), }) return err }