S3 throws error with latest curl in amz1 when getObject

0

Greetings!

Since updating curl to version curl-7.61.1-7.91.amzn1.i686 getObject(SDK) throws the following error when retrieving a file with Content-Encoding=UTF-8 and Content-type=text/html. Does not happen with previous version curl-7.53.1-16.86.amzn1.i686 which works flawless:

.....
exception 'Aws\S3\Exception\S3Exception' with message 'Error executing "GetObject" on "XXXXXXXX"; AWS HTTP error: cURL error 61: Unrecognized content encoding type. libcurl understands deflate, gzip content encodings. (see http://curl.haxx.se/libcurl/c/libcurl-errors.html) (server): 200 OK (Request-ID: CB1F86A65ABDFF78) - '
....
exception 'GuzzleHttp\Exception\RequestException' with message 'cURL error 61: Unrecognized content encoding type. libcurl understands deflate, gzip content encodings. (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
.....

已提問 5 年前檢視次數 532 次
2 個答案
0
已接受的答案

I suffer form the same issue. I succeeded in getting this issue work by using 'http' => ['decode_content' => false], in the S3 client constructor, like

$client = new S3Client([
   'region'  => 'us-west-2',
   'version' => 'latest',
   'http'    => ['decode_content' => false],
]);
已回答 5 年前
0

Thanks for the tip, it worked.

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南