mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[chore] update dependencies, bump to Go 1.19.1 (#826)
* update dependencies, bump Go version to 1.19 * bump test image Go version * update golangci-lint * update gotosocial-drone-build * sign * linting, go fmt * update swagger docs * update swagger docs * whitespace * update contributing.md * fuckin whoopsie doopsie * linterino, linteroni * fix followrequest test not starting processor * fix other api/client tests not starting processor * fix remaining tests where processor not started * bump go-runners version * don't check last-webfingered-at, processor may have updated this * update swagger command * update bun to latest version * fix embed to work the same as before with new bun Signed-off-by: kim <grufwub@gmail.com> Co-authored-by: tsmethurst <tobi.smethurst@protonmail.com>
This commit is contained in:
35
vendor/github.com/minio/minio-go/v7/api.go
generated
vendored
35
vendor/github.com/minio/minio-go/v7/api.go
generated
vendored
@ -111,7 +111,7 @@ type Options struct {
|
||||
// Global constants.
|
||||
const (
|
||||
libraryName = "minio-go"
|
||||
libraryVersion = "v7.0.29"
|
||||
libraryVersion = "v7.0.36"
|
||||
)
|
||||
|
||||
// User Agent should always following the below style.
|
||||
@ -315,14 +315,16 @@ func (c *Client) SetS3TransferAccelerate(accelerateEndpoint string) {
|
||||
// - For signature v4 request if the connection is insecure compute only sha256.
|
||||
// - For signature v4 request if the connection is secure compute only md5.
|
||||
// - For anonymous request compute md5.
|
||||
func (c *Client) hashMaterials(isMd5Requested bool) (hashAlgos map[string]md5simd.Hasher, hashSums map[string][]byte) {
|
||||
func (c *Client) hashMaterials(isMd5Requested, isSha256Requested bool) (hashAlgos map[string]md5simd.Hasher, hashSums map[string][]byte) {
|
||||
hashSums = make(map[string][]byte)
|
||||
hashAlgos = make(map[string]md5simd.Hasher)
|
||||
if c.overrideSignerType.IsV4() {
|
||||
if c.secure {
|
||||
hashAlgos["md5"] = c.md5Hasher()
|
||||
} else {
|
||||
hashAlgos["sha256"] = c.sha256Hasher()
|
||||
if isSha256Requested {
|
||||
hashAlgos["sha256"] = c.sha256Hasher()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if c.overrideSignerType.IsAnonymous() {
|
||||
@ -377,21 +379,20 @@ func (c *Client) HealthCheck(hcDuration time.Duration) (context.CancelFunc, erro
|
||||
atomic.StoreInt32(&c.healthStatus, unknown)
|
||||
return
|
||||
case <-timer.C:
|
||||
timer.Reset(duration)
|
||||
// Do health check the first time and ONLY if the connection is marked offline
|
||||
if c.IsOffline() {
|
||||
gctx, gcancel := context.WithTimeout(context.Background(), 3*time.Second)
|
||||
_, err := c.getBucketLocation(gctx, probeBucketName)
|
||||
gcancel()
|
||||
if IsNetworkOrHostDown(err, false) {
|
||||
// Still network errors do not need to do anything.
|
||||
continue
|
||||
}
|
||||
switch ToErrorResponse(err).Code {
|
||||
case "NoSuchBucket", "AccessDenied", "":
|
||||
atomic.CompareAndSwapInt32(&c.healthStatus, offline, online)
|
||||
if !IsNetworkOrHostDown(err, false) {
|
||||
switch ToErrorResponse(err).Code {
|
||||
case "NoSuchBucket", "AccessDenied", "":
|
||||
atomic.CompareAndSwapInt32(&c.healthStatus, offline, online)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
timer.Reset(duration)
|
||||
}
|
||||
}
|
||||
}(hcDuration)
|
||||
@ -417,6 +418,7 @@ type requestMetadata struct {
|
||||
contentLength int64
|
||||
contentMD5Base64 string // carries base64 encoded md5sum
|
||||
contentSHA256Hex string // carries hex encoded sha256sum
|
||||
streamSha256 bool
|
||||
}
|
||||
|
||||
// dumpHTTP - dump HTTP request and response.
|
||||
@ -593,12 +595,11 @@ func (c *Client) executeMethod(ctx context.Context, method string, metadata requ
|
||||
// Initiate the request.
|
||||
res, err = c.do(req)
|
||||
if err != nil {
|
||||
if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) {
|
||||
return nil, err
|
||||
if isRequestErrorRetryable(err) {
|
||||
// Retry the request
|
||||
continue
|
||||
}
|
||||
|
||||
// Retry the request
|
||||
continue
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// For any known successful http status, return quickly.
|
||||
@ -812,7 +813,7 @@ func (c *Client) newRequest(ctx context.Context, method string, metadata request
|
||||
case signerType.IsV2():
|
||||
// Add signature version '2' authorization header.
|
||||
req = signer.SignV2(*req, accessKeyID, secretAccessKey, isVirtualHost)
|
||||
case metadata.objectName != "" && metadata.queryValues == nil && method == http.MethodPut && metadata.customHeader.Get("X-Amz-Copy-Source") == "" && !c.secure:
|
||||
case metadata.streamSha256 && !c.secure:
|
||||
// Streaming signature is used by default for a PUT object request. Additionally we also
|
||||
// look if the initialized client is secure, if yes then we don't need to perform
|
||||
// streaming signature.
|
||||
|
Reference in New Issue
Block a user