File tree Expand file tree Collapse file tree
src/main/java/com/linglevel/api/s3/config Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77import software .amazon .awssdk .auth .credentials .StaticCredentialsProvider ;
88import software .amazon .awssdk .regions .Region ;
99import software .amazon .awssdk .services .s3 .S3Client ;
10+ import software .amazon .awssdk .services .s3 .S3Configuration ;
1011
1112import java .net .URI ;
1213
@@ -63,10 +64,17 @@ public S3Client s3AiClient() {
6364 public S3Client s3StaticClient () {
6465 AwsBasicCredentials credentials = AwsBasicCredentials .create (r2AccessKey , r2SecretKey );
6566
67+ // R2 전용 설정 객체 생성
68+ S3Configuration serviceConfiguration = S3Configuration .builder ()
69+ .pathStyleAccessEnabled (true )
70+ .chunkedEncodingEnabled (false )
71+ .build ();
72+
6673 return S3Client .builder ()
6774 .endpointOverride (URI .create (r2Endpoint ))
68- .region (Region .of ("auto" )) // R2는 auto region 사용
75+ .region (Region .of ("auto" ))
6976 .credentialsProvider (StaticCredentialsProvider .create (credentials ))
77+ .serviceConfiguration (serviceConfiguration )
7078 .build ();
7179 }
7280
You can’t perform that action at this time.
0 commit comments