From 1d0a1d82611f870f6bcd3fea78cd689816273831 Mon Sep 17 00:00:00 2001 From: niksis02 Date: Mon, 17 Nov 2025 20:13:34 +0400 Subject: [PATCH] fix: fixes the panic in GetBucketVersioning in s3 proxy Fixes #1649 `GetBucketVersioning` used to be a cause of a panic in s3 proxy backend, because of an inproper error handling. Now the error returned from the sdk method is explitily checked, before returning the response. --- backend/s3proxy/s3.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/s3proxy/s3.go b/backend/s3proxy/s3.go index 337d3888..26977793 100644 --- a/backend/s3proxy/s3.go +++ b/backend/s3proxy/s3.go @@ -285,11 +285,14 @@ func (s *S3Proxy) GetBucketVersioning(ctx context.Context, bucket string) (s3res out, err := s.client.GetBucketVersioning(ctx, &s3.GetBucketVersioningInput{ Bucket: &bucket, }) + if err != nil { + return s3response.GetBucketVersioningOutput{}, handleError(err) + } return s3response.GetBucketVersioningOutput{ Status: &out.Status, MFADelete: &out.MFADelete, - }, handleError(err) + }, nil } func (s *S3Proxy) ListObjectVersions(ctx context.Context, input *s3.ListObjectVersionsInput) (s3response.ListVersionsResult, error) {