[#7523] added Accept-Encoding:identity to the S3 requests

This commit is contained in:
Gani Georgiev
2026-02-13 16:16:12 +02:00
parent 5715e11e52
commit 5b2cae8509
2 changed files with 11 additions and 0 deletions

View File

@@ -150,6 +150,12 @@ func (s3 *S3) SignAndSend(req *http.Request) (*http.Response, error) {
// https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv-create-signed-request.html#create-signed-request-steps
func (s3 *S3) sign(req *http.Request) {
// explicitly set Accept-Encoding to avoid transparent decompression
// and Content-Length zeroing (https://github.com/pocketbase/pocketbase/issues/7523)
if req.Header.Get("Accept-Encoding") == "" {
req.Header.Set("Accept-Encoding", "identity")
}
// fallback to the Unsigned payload option
// (data integrity checks could be still applied via the content-md5 or x-amz-checksum-* headers)
if req.Header.Get("x-amz-content-sha256") == "" {