~bigbes/sourcehut-root

ref: dac87f392932225a36061838adbea0d8fa3cee44 sourcehut-root/patches/core-go-checksum.patch -rw-r--r-- 789 bytes
dac87f39 — Eugene Blikh Add BSD 2-Clause license for original workspace files 6 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/objects/middleware.go b/objects/middleware.go
index efdb4b5..520781b 100644
--- a/objects/middleware.go
+++ b/objects/middleware.go
@@ -88,6 +88,11 @@ func NewClient(conf ini.File) (*s3.Client, error) {
 		Region:      region,
 		Credentials: creds,
 	}, func(opts *s3.Options) {
+		// Patched (phoebe-lab): AWS SDK v2 defaults to WhenSupported, which seeks
+		// non-seekable PutObject bodies (pages Publish, builds artifact upload)
+		// for checksum computation. Use WhenRequired to skip pre-flight hashing.
+		opts.RequestChecksumCalculation = aws.RequestChecksumCalculationWhenRequired
+		opts.ResponseChecksumValidation = aws.ResponseChecksumValidationWhenRequired
 		opts.BaseEndpoint = aws.String(scheme + upstream)
 		opts.EndpointResolverV2 = &S3Resolver{
 			conf,