mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-10-30 21:32:25 -05:00 
			
		
		
		
	[chore] bump dependencies (#4339)
- github.com/KimMachineGun/automemlimit v0.7.4 - github.com/miekg/dns v1.1.67 - github.com/minio/minio-go/v7 v7.0.95 - github.com/spf13/pflag v1.0.7 - github.com/tdewolff/minify/v2 v2.23.9 - github.com/uptrace/bun v1.2.15 - github.com/uptrace/bun/dialect/pgdialect v1.2.15 - github.com/uptrace/bun/dialect/sqlitedialect v1.2.15 - github.com/uptrace/bun/extra/bunotel v1.2.15 - golang.org/x/image v0.29.0 - golang.org/x/net v0.42.0 Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4339 Co-authored-by: kim <grufwub@gmail.com> Co-committed-by: kim <grufwub@gmail.com>
This commit is contained in:
		
					parent
					
						
							
								eb60081985
							
						
					
				
			
			
				commit
				
					
						c00cad2ceb
					
				
			
		
					 76 changed files with 5544 additions and 886 deletions
				
			
		
							
								
								
									
										48
									
								
								vendor/github.com/minio/minio-go/v7/api-put-object.go
									
										
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										48
									
								
								vendor/github.com/minio/minio-go/v7/api-put-object.go
									
										
									
										generated
									
									
										vendored
									
									
								
							|  | @ -26,6 +26,7 @@ import ( | |||
| 	"io" | ||||
| 	"net/http" | ||||
| 	"sort" | ||||
| 	"strings" | ||||
| 	"time" | ||||
| 
 | ||||
| 	"github.com/minio/minio-go/v7/pkg/encrypt" | ||||
|  | @ -267,7 +268,16 @@ func (opts PutObjectOptions) validate(c *Client) (err error) { | |||
| 	if opts.LegalHold != "" && !opts.LegalHold.IsValid() { | ||||
| 		return errInvalidArgument(opts.LegalHold.String() + " unsupported legal-hold status") | ||||
| 	} | ||||
| 	if opts.Checksum.IsSet() { | ||||
| 
 | ||||
| 	checkCrc := false | ||||
| 	for k := range opts.UserMetadata { | ||||
| 		if strings.HasPrefix(k, "x-amz-checksum-") { | ||||
| 			checkCrc = true | ||||
| 			break | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	if opts.Checksum.IsSet() || checkCrc { | ||||
| 		switch { | ||||
| 		case !c.trailingHeaderSupport: | ||||
| 			return errInvalidArgument("Checksum requires Client with TrailingHeaders enabled") | ||||
|  | @ -307,10 +317,10 @@ func (a completedParts) Less(i, j int) bool { return a[i].PartNumber < a[j].Part | |||
| //     be reused for best outcomes for PutObject(), pass the size always. | ||||
| // | ||||
| // NOTE: Upon errors during upload multipart operation is entirely aborted. | ||||
| func (c *Client) PutObject(ctx context.Context, bucketName, objectName string, reader io.Reader, objectSize int64, | ||||
| func (c *Client) PutObject(ctx context.Context, bucketName, objectName string, reader io.Reader, size int64, | ||||
| 	opts PutObjectOptions, | ||||
| ) (info UploadInfo, err error) { | ||||
| 	if objectSize < 0 && opts.DisableMultipart { | ||||
| 	if size < 0 && opts.DisableMultipart { | ||||
| 		return UploadInfo{}, errors.New("object size must be provided with disable multipart upload") | ||||
| 	} | ||||
| 
 | ||||
|  | @ -319,15 +329,20 @@ func (c *Client) PutObject(ctx context.Context, bucketName, objectName string, r | |||
| 		return UploadInfo{}, err | ||||
| 	} | ||||
| 
 | ||||
| 	return c.putObjectCommon(ctx, bucketName, objectName, reader, objectSize, opts) | ||||
| } | ||||
| 
 | ||||
| func (c *Client) putObjectCommon(ctx context.Context, bucketName, objectName string, reader io.Reader, size int64, opts PutObjectOptions) (info UploadInfo, err error) { | ||||
| 	// Check for largest object size allowed. | ||||
| 	if size > int64(maxMultipartPutObjectSize) { | ||||
| 		return UploadInfo{}, errEntityTooLarge(size, maxMultipartPutObjectSize, bucketName, objectName) | ||||
| 	} | ||||
| 	opts.AutoChecksum.SetDefault(ChecksumCRC32C) | ||||
| 
 | ||||
| 	if opts.Checksum.IsSet() { | ||||
| 		opts.AutoChecksum = opts.Checksum | ||||
| 		opts.SendContentMd5 = false | ||||
| 	} | ||||
| 
 | ||||
| 	if c.trailingHeaderSupport { | ||||
| 		opts.AutoChecksum.SetDefault(ChecksumCRC32C) | ||||
| 		addAutoChecksumHeaders(&opts) | ||||
| 	} | ||||
| 
 | ||||
| 	// NOTE: Streaming signature is not supported by GCS. | ||||
| 	if s3utils.IsGoogleEndpoint(*c.endpointURL) { | ||||
|  | @ -385,20 +400,11 @@ func (c *Client) putObjectMultipartStreamNoLength(ctx context.Context, bucketNam | |||
| 		return UploadInfo{}, err | ||||
| 	} | ||||
| 
 | ||||
| 	if opts.Checksum.IsSet() { | ||||
| 		opts.SendContentMd5 = false | ||||
| 		opts.AutoChecksum = opts.Checksum | ||||
| 	} | ||||
| 	if !opts.SendContentMd5 { | ||||
| 		addAutoChecksumHeaders(&opts) | ||||
| 	} | ||||
| 
 | ||||
| 	// Initiate a new multipart upload. | ||||
| 	uploadID, err := c.newUploadID(ctx, bucketName, objectName, opts) | ||||
| 	if err != nil { | ||||
| 		return UploadInfo{}, err | ||||
| 	} | ||||
| 	delete(opts.UserMetadata, "X-Amz-Checksum-Algorithm") | ||||
| 
 | ||||
| 	defer func() { | ||||
| 		if err != nil { | ||||
|  | @ -437,11 +443,17 @@ func (c *Client) putObjectMultipartStreamNoLength(ctx context.Context, bucketNam | |||
| 			hash.Write(buf[:length]) | ||||
| 			md5Base64 = base64.StdEncoding.EncodeToString(hash.Sum(nil)) | ||||
| 			hash.Close() | ||||
| 		} else { | ||||
| 		} | ||||
| 
 | ||||
| 		if opts.AutoChecksum.IsSet() { | ||||
| 			crc.Reset() | ||||
| 			crc.Write(buf[:length]) | ||||
| 			cSum := crc.Sum(nil) | ||||
| 			customHeader.Set(opts.AutoChecksum.Key(), base64.StdEncoding.EncodeToString(cSum)) | ||||
| 			customHeader.Set(amzChecksumAlgo, opts.AutoChecksum.String()) | ||||
| 			if opts.AutoChecksum.FullObjectRequested() { | ||||
| 				customHeader.Set(amzChecksumMode, ChecksumFullObjectMode.String()) | ||||
| 			} | ||||
| 		} | ||||
| 
 | ||||
| 		// Update progress reader appropriately to the latest offset | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue