mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-11-03 19:42:25 -06:00 
			
		
		
		
	bump dependencies: minio-go, go-sqlite3, goldmark, otel, x/image/webp (#4075)
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4075 Co-authored-by: kim <grufwub@gmail.com> Co-committed-by: kim <grufwub@gmail.com>
This commit is contained in:
		
					parent
					
						
							
								457ca3c9d3
							
						
					
				
			
			
				commit
				
					
						436765a6a2
					
				
			
		
					 31 changed files with 500 additions and 167 deletions
				
			
		
							
								
								
									
										25
									
								
								vendor/github.com/minio/minio-go/v7/pkg/signer/request-signature-v4.go
									
										
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										25
									
								
								vendor/github.com/minio/minio-go/v7/pkg/signer/request-signature-v4.go
									
										
									
										generated
									
									
										vendored
									
									
								
							| 
						 | 
				
			
			@ -333,11 +333,34 @@ func signV4(req http.Request, accessKeyID, secretAccessKey, sessionToken, locati
 | 
			
		|||
	if len(trailer) > 0 {
 | 
			
		||||
		// Use custom chunked encoding.
 | 
			
		||||
		req.Trailer = trailer
 | 
			
		||||
		return StreamingUnsignedV4(&req, sessionToken, req.ContentLength, time.Now().UTC())
 | 
			
		||||
		return StreamingUnsignedV4(&req, sessionToken, req.ContentLength, t)
 | 
			
		||||
	}
 | 
			
		||||
	return &req
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// UnsignedTrailer will do chunked encoding with a custom trailer.
 | 
			
		||||
func UnsignedTrailer(req http.Request, trailer http.Header) *http.Request {
 | 
			
		||||
	if len(trailer) == 0 {
 | 
			
		||||
		return &req
 | 
			
		||||
	}
 | 
			
		||||
	// Initial time.
 | 
			
		||||
	t := time.Now().UTC()
 | 
			
		||||
 | 
			
		||||
	// Set x-amz-date.
 | 
			
		||||
	req.Header.Set("X-Amz-Date", t.Format(iso8601DateFormat))
 | 
			
		||||
 | 
			
		||||
	for k := range trailer {
 | 
			
		||||
		req.Header.Add("X-Amz-Trailer", strings.ToLower(k))
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	req.Header.Set("Content-Encoding", "aws-chunked")
 | 
			
		||||
	req.Header.Set("x-amz-decoded-content-length", strconv.FormatInt(req.ContentLength, 10))
 | 
			
		||||
 | 
			
		||||
	// Use custom chunked encoding.
 | 
			
		||||
	req.Trailer = trailer
 | 
			
		||||
	return StreamingUnsignedV4(&req, "", req.ContentLength, t)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// SignV4 sign the request before Do(), in accordance with
 | 
			
		||||
// http://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html.
 | 
			
		||||
func SignV4(req http.Request, accessKeyID, secretAccessKey, sessionToken, location string) *http.Request {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue