Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,18 @@ public class RedirectService implements RedirectUseCase {
@Override
public void redirect(HttpServletRequest request, HttpServletResponse response, String path) {
try {
redirectStrategy.sendRedirect(request, response, path);
redirectStrategy.sendRedirect(request, response, frontUrl + path);
} catch (IOException e) {
log.error("리디렉션 중 오류 발생 - 대상 URL: {}, 메시지: {}", path, e.getMessage());
handleRedirectFailure(request, response);
}
}

private void handleRedirectFailure(HttpServletRequest request, HttpServletResponse response) {
String fallbackUrl = buildFallbackUrl();
try {
redirectStrategy.sendRedirect(request, response, fallbackUrl);
redirectStrategy.sendRedirect(request, response, frontUrl + ERROR_PATH);
} catch (IOException e) {
log.error("에러 페이지로 리디렉션 시도 중 오류 발생 - 메시지: {}", e.getMessage());
}
}

private String buildFallbackUrl() {
return frontUrl + RedirectService.ERROR_PATH;
}
}
Loading