Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[톰캣 구현하기 - 3, 4단계] 제이미(임정수) 미션 제출합니다. #469

Merged
merged 15 commits into from
Sep 14, 2023

Conversation

JJ503
Copy link
Member

@JJ503 JJ503 commented Sep 11, 2023

안녕하세요 엔초!
지난 1, 2 단계 때 디테일한 리뷰 감사했습니다!
답변들에 대해선 해당 pr 코멘드 댓글로 작성했습니다. (1, 2단계 바로가기)

시간 문제로 리팩토링 하지 못한 부분이 몇 가지 있어 해당 부분은 엔초 피드백과 함께 수정하려고 합니다.

  • 예외 처리에 대한 위치 고민
  • null이 반환되지 않도록 수정
  • 2dept 제거 및 클래스 별 10라인 내로 작성

이번 리뷰도 잘 부탁드립니다!

@JJ503 JJ503 self-assigned this Sep 11, 2023
@sonarcloud
Copy link

sonarcloud bot commented Sep 11, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 14 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

warning The version of Java (11.0.20.1) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17.
Read more here

Copy link

@kwonyj1022 kwonyj1022 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

제이미 수고하셨습니다~!

Comment on lines +14 to +18
private static final Map<String, Controller> CONTROLLERS = Map.of(
"/", new MainController(),
"/login", new LoginController(),
"/register", new RegisterController()
);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

애플리케이션을 실행할 때 한 번만 초기화되도록 하신 거군요! 저는 이거 생각 못해서 피드백받았는데 대단해요~ 그리고 맵으로 할 생각을 못했는데 맵으로 하니까 더 깔끔한 것 같아요! 👍👍 역시 제이미!

Comment on lines +27 to +30
private void validateUser(final String account, final String password, final String email) throws LoginException {
if (StringUtils.isEmpty(account) || StringUtils.isEmpty(password) || StringUtils.isEmpty(email)) {
throw new LoginException();
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

회원가입을 할 수 없을 때 예외를 던지는 메서드인 것 같습니다. 회원가입과 관련된 것인데 LoginException을 던지도록 한 이유가 궁금합니다!

Comment on lines +52 to +56
protected static HttpResponse getRedirectResponse(final String location) {
final StatusLine statusLine = new StatusLine(HttpVersion.HTTP_1_1, StatusCode.FOUND);

return HttpResponse.ofRedirect(statusLine, location);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저번 리뷰에서 모든 리다이렉트를 FOUND로 보내는 이유에 대해 물었었고 답변으로 FOUND가 아니면 리다이렉트 페이지가 나오지 않는다고 답변을 해주셨는데요, 저는 401이나 500 모두 페이지가 잘 나오는 것을 확인했습니다. 상태코드도 FOUND가 아니고요

image

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이것저것 해보니까 HttpResponse.ofRedirect() 에서 Location 헤더를 사용하기 때문에 그런 것 같습니다. 저는 Location 헤더를 사용하지 않고 그냥 index.html 보여주듯이 처리해서 관련 문제가 없었던 것 같아요

@kwonyj1022 kwonyj1022 merged commit 7028e1f into woowacourse:jj503 Sep 14, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants