File tree 1 file changed +8
-1
lines changed
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 5
5
"context"
6
6
"crypto/tls"
7
7
"errors"
8
+ "github.com/aws/aws-sdk-go/aws/request"
8
9
"io"
9
10
"net/http"
10
11
"net/url"
@@ -190,6 +191,12 @@ func (st *S3Storage) PutObject(obj *storage.Object) error {
190
191
return nil
191
192
}
192
193
194
+ func withAcceptEncoding (e string ) request.Option {
195
+ return func (r * request.Request ) {
196
+ r .HTTPRequest .Header .Add ("Accept-Encoding" , e )
197
+ }
198
+ }
199
+
193
200
// GetObjectContent read object content and metadata from S3.
194
201
func (st * S3Storage ) GetObjectContent (obj * storage.Object ) error {
195
202
input := & s3.GetObjectInput {
@@ -198,7 +205,7 @@ func (st *S3Storage) GetObjectContent(obj *storage.Object) error {
198
205
VersionId : obj .VersionId ,
199
206
}
200
207
201
- result , err := st .awsSvc .GetObjectWithContext (st .ctx , input )
208
+ result , err := st .awsSvc .GetObjectWithContext (st .ctx , input , withAcceptEncoding ( "gzip" ) )
202
209
if err != nil {
203
210
return err
204
211
}
You can’t perform that action at this time.
0 commit comments