diff --git a/src/main/java/com/moddy/server/external/s3/S3Service.java b/src/main/java/com/moddy/server/external/s3/S3Service.java index be21177d..29128d0f 100644 --- a/src/main/java/com/moddy/server/external/s3/S3Service.java +++ b/src/main/java/com/moddy/server/external/s3/S3Service.java @@ -26,7 +26,7 @@ public class S3Service { private final static String APPLICATION_PATH = "APPLICATION"; private final static String MODEL_PROFILE_PATH = "HAIR_MODEL_PROFILE"; private final static String MODEL_PROFILE_IMAGE_NAME = "/model_default_profile.png"; - private final static int IMAGE_URL_PREFIX_LENGTH = 54; + private final static int IMAGE_URL_PREFIX_LENGTH = 41; private final static int EXPIRED_TIME = 3; private final AmazonS3 amazonS3; @Value("${cloud.aws.s3.bucket}") @@ -76,7 +76,7 @@ private String uploadImage(MultipartFile multipartFile, String path) { } private String getImageUrlToKey(final String imageUrl) { - return imageUrl.substring(IMAGE_URL_PREFIX_LENGTH); + return imageUrl.substring(IMAGE_URL_PREFIX_LENGTH + bucket.length()); } private Date getExpiredTime() {