summaryrefslogtreecommitdiff
path: root/vendor/github.com/minio/minio-go/v7/api-bucket-cors.go
diff options
context:
space:
mode:
authorLibravatar kim <grufwub@gmail.com>2025-11-05 21:58:38 +0100
committerLibravatar tobi <tobi.smethurst@protonmail.com>2025-11-17 14:12:41 +0100
commitd0c551acb5ab79efafd325f5b19c76a3de835356 (patch)
treeba9462cdc5081015fbd6bf5d98d9f39334d13207 /vendor/github.com/minio/minio-go/v7/api-bucket-cors.go
parent[performance] when transforming media, perform read operations of large files... (diff)
downloadgotosocial-d0c551acb5ab79efafd325f5b19c76a3de835356.tar.xz
[chore] update dependencies (#4542)
- github.com/minio/minio-go/v7: v7.0.95 -> v7.0.97 - github.com/ncruces/go-sqlite3: v0.29.1 -> v0.30.0 - github.com/tdewolff/minify/v2: v2.24.5 -> v2.24.6 - codeberg.org/gruf/go-mmap: fixes build for BSD platforms Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4542 Co-authored-by: kim <grufwub@gmail.com> Co-committed-by: kim <grufwub@gmail.com>
Diffstat (limited to 'vendor/github.com/minio/minio-go/v7/api-bucket-cors.go')
-rw-r--r--vendor/github.com/minio/minio-go/v7/api-bucket-cors.go19
1 files changed, 17 insertions, 2 deletions
diff --git a/vendor/github.com/minio/minio-go/v7/api-bucket-cors.go b/vendor/github.com/minio/minio-go/v7/api-bucket-cors.go
index 9d514947d..9967fe39e 100644
--- a/vendor/github.com/minio/minio-go/v7/api-bucket-cors.go
+++ b/vendor/github.com/minio/minio-go/v7/api-bucket-cors.go
@@ -26,7 +26,15 @@ import (
"github.com/minio/minio-go/v7/pkg/s3utils"
)
-// SetBucketCors sets the cors configuration for the bucket
+// SetBucketCors sets the Cross-Origin Resource Sharing (CORS) configuration for the bucket.
+// If corsConfig is nil, the existing CORS configuration will be removed.
+//
+// Parameters:
+// - ctx: Context for request cancellation and timeout
+// - bucketName: Name of the bucket
+// - corsConfig: CORS configuration to apply (nil to remove existing configuration)
+//
+// Returns an error if the operation fails.
func (c *Client) SetBucketCors(ctx context.Context, bucketName string, corsConfig *cors.Config) error {
if err := s3utils.CheckValidBucketName(bucketName); err != nil {
return err
@@ -90,7 +98,14 @@ func (c *Client) removeBucketCors(ctx context.Context, bucketName string) error
return nil
}
-// GetBucketCors returns the current cors
+// GetBucketCors retrieves the Cross-Origin Resource Sharing (CORS) configuration from the bucket.
+// If no CORS configuration exists, returns nil with no error.
+//
+// Parameters:
+// - ctx: Context for request cancellation and timeout
+// - bucketName: Name of the bucket
+//
+// Returns the CORS configuration or an error if the operation fails.
func (c *Client) GetBucketCors(ctx context.Context, bucketName string) (*cors.Config, error) {
if err := s3utils.CheckValidBucketName(bucketName); err != nil {
return nil, err