Skip to content

Commit

Permalink
fix: CloudFront 주소 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueBerrySoda committed Jun 9, 2024
1 parent 9f6aa63 commit 924b566
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public class S3ImageService {

@Value("${cloud.aws.s3.bucketName}")
private String bucketName;
@Value("${cloud.aws.s3.cloudfront.domain}")
private String cloudFront;

public String upload(MultipartFile image) {
if(image.isEmpty() || Objects.isNull(image.getOriginalFilename())){
Expand Down Expand Up @@ -95,7 +97,7 @@ private String uploadImageToS3(MultipartFile image) throws IOException {
}

// pictureRepository.save(Picture.builder().pictureUrl(amazonS3.getUrl(bucketName, s3FileName).toString())..build())
return amazonS3.getUrl(bucketName, s3FileName).toString();
return cloudFront + s3FileName;
}

public void deleteImageFromS3(String imageAddress){
Expand Down

0 comments on commit 924b566

Please sign in to comment.