diff --git a/backend/src/main/java/ddangkong/controller/room/RoomMemberCookieEncryptor.java b/backend/src/main/java/ddangkong/controller/room/RoomMemberCookieEncryptor.java index 9fce0c3d..72465a5b 100644 --- a/backend/src/main/java/ddangkong/controller/room/RoomMemberCookieEncryptor.java +++ b/backend/src/main/java/ddangkong/controller/room/RoomMemberCookieEncryptor.java @@ -10,7 +10,7 @@ public class RoomMemberCookieEncryptor { private static final String DEFAULT_PATH = "/api/balances/rooms"; private static final String NONE = "None"; private static final String LAX = "Lax"; - private static final String LOCALHOST = "localhost"; + private static final String LOCALHOST = "http://localhost"; private final EncryptionUtils encryptionUtils; @@ -32,7 +32,7 @@ public ResponseCookie getEncodedCookie(Object value, String requestURI) { } private String getSameSiteOption(String uri) { - if (uri.equals(LOCALHOST)) { + if (uri.startsWith(LOCALHOST)) { return NONE; } return LAX; diff --git a/backend/src/test/java/ddangkong/controller/room/RoomMemberCookieEncryptorTest.java b/backend/src/test/java/ddangkong/controller/room/RoomMemberCookieEncryptorTest.java index db88078e..68d564fe 100644 --- a/backend/src/test/java/ddangkong/controller/room/RoomMemberCookieEncryptorTest.java +++ b/backend/src/test/java/ddangkong/controller/room/RoomMemberCookieEncryptorTest.java @@ -20,7 +20,7 @@ class 방_멤버_쿠키_암호화 { void 로컬_환경인_경우_SameSite는_None_이다() { // given String value = "ThisIsMySecretKe"; - String uri = "localhost"; + String uri = "http://localhost:3306/api"; // when ResponseCookie encodedCookie = roomMemberCookieEncryptor.getEncodedCookie(value, uri);