Commit cb701d7d7f4ead4e3063b93536c53ef2abf0ec2f
1 parent
4dde700f
fix:【INFRA】阿里云 S3 上传时,会 aws-chunked encoding is not supported 报错的问题
Showing
1 changed file
with
3 additions
and
1 deletions
yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/s3/S3FileClient.java
| ... | ... | @@ -46,7 +46,9 @@ public class S3FileClient extends AbstractFileClient<S3FileClientConfig> { |
| 46 | 46 | AwsBasicCredentials.create(config.getAccessKey(), config.getAccessSecret())); |
| 47 | 47 | URI endpoint = URI.create(buildEndpoint()); |
| 48 | 48 | S3Configuration serviceConfiguration = S3Configuration.builder() // Path-style 访问 |
| 49 | - .pathStyleAccessEnabled(Boolean.TRUE.equals(config.getEnablePathStyleAccess())).build(); | |
| 49 | + .pathStyleAccessEnabled(Boolean.TRUE.equals(config.getEnablePathStyleAccess())) | |
| 50 | + .chunkedEncodingEnabled(false) // 禁用分块编码,参见 https://t.zsxq.com/kBy57 | |
| 51 | + .build(); | |
| 50 | 52 | client = S3Client.builder() |
| 51 | 53 | .credentialsProvider(credentialsProvider) |
| 52 | 54 | .region(region) | ... | ... |