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

[럿고] 2단계 - HTTP 웹 서버 리팩토링 미션 제출합니다. #149

Merged
merged 19 commits into from
Oct 17, 2020

Conversation

ksy90101
Copy link

@ksy90101 ksy90101 commented Oct 4, 2020

안녕하세요! 홍시 1단계 리뷰 잘 받았습니다!
코드가 훨씬 더 좋아진거 같아요!
이번 미션하면서 너무 궁금한게 많아졌습니다.. ㅠㅠㅠ
시간 나시면 답변 부탁드릴게요!

  1. 스레드 수를 어떻게 계산을 해야 하는지가 궁금합니다. (공식은 있다고 찾아봤습니다. 공식대로 하는게 맞는지, 지금 같은 미션에서는 어떻게 스레드를 두는게 가장 최적인지가 궁금합니다.)
    참고링크1
    참고링크2

  2. index.html을 호출 했을 떄 Content-Length가 저는 6902가 나오고 페어는 7049가 나오면서 서로 다른걸 확인할 수 있는데, 이거에 대한 이유를 알 수 있을까요!?
    찾아봐도 잘 모르겠어서 여쭤봅니다. 저희 생각에는 현재 Enter Line때문인거 같은데,....혹시 운영체제마다도 다른건가요!?(현재 맥과 윈도우를 사용해서 테스트를 했습니다.)

  3. 공통으로 쓰이는 상수 (예를 들어 " ") 이런 것을 클래스를 하나 만들어서 공통으로 사용하는 것이 일반적으로 그렇게 사용하는지 궁금합니다!

  4. ExecutorService 이 클래스는 shutdown()이 있던데, 저희가 사용할때는 이러한 닫는 메서드를 실행할 필요가 없는지 궁금합니다!
    (예를들어 InputStream같은 경우는 close를 하는데, 이 친구는 할 필요가 없는지 궁금합니다!)

  5. 응답 명세를 직접 만들어서 매핑이 잘 되는지 확인하는 것이 더 좋은지 지금과 같이 txt 파일을 생성시켜서 txt파일이 생성되어서 그걸 확인하는게 더 나은 테스트인지가 궁금합니다.

  6. uri 중에 지원하지 않은 메서드는 어떻게 처리를 해야 할지 궁금합니다. 예를들어 index.html 같은 경우에는 get 메서드는 지원하지만, Post 메서드는 지원하지 않을 텐데요. 저희는 현재 모두 예외 처리를 해놨습니다. 이러한게 맞는건지... 어떻게 처리 하는게 더 좋은 지 궁금합니다.

hwanghe159 and others added 15 commits September 12, 2020 21:13
* docs: README.md 작성

* feat: URL추출 메서드 및 request header 출력 메서드 작성

* feat: /index.html로 접속했을 때 index.html 파일 응답 구현

* feat: 회원가입 시 회원에 대한 정보를 서버에 저장하는 로직 구현

* feat: post 처리 및 요청 값 객체 생성

* feat: 요구사항3 완료

* feat: 302 response 구현

* refactor: 요청에 따른 응답을 컨트롤러로 처리하도록 수정

Co-authored-by: SeYun <ksy90101@naver.com>
@ksy90101 ksy90101 changed the base branch from master to ksy90101 October 4, 2020 13:24
Copy link

@hongsii hongsii left a comment

Choose a reason for hiding this comment

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

럿고 2단계 요구사항 구현도 잘 해주셨네요~! 👍
질문 주신 내용에 대한 답변과 함께 몇 가지 피드백을 남겼으니, 확인하시고 반영해주세요~!

src/main/java/controller/IndexController.java Outdated Show resolved Hide resolved
src/main/java/http/request/RequestLine.java Outdated Show resolved Hide resolved
src/main/java/http/response/Response.java Outdated Show resolved Hide resolved
src/main/java/http/response/Response.java Outdated Show resolved Hide resolved
src/main/java/webserver/WebServer.java Show resolved Hide resolved
src/test/java/controller/ResourceControllerTest.java Outdated Show resolved Hide resolved
src/main/java/controller/AbstractController.java Outdated Show resolved Hide resolved
src/main/java/controller/IndexController.java Show resolved Hide resolved
src/main/java/http/HttpHeader.java Outdated Show resolved Hide resolved
src/main/java/http/response/Response.java Outdated Show resolved Hide resolved
Copy link

@hongsii hongsii left a comment

Choose a reason for hiding this comment

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

피드백 반영을 잘 해주셨네요! 💯
다음 단계 진행해주세요~!

import http.request.RequestMethod;
import http.response.Status;

public class HttpRequestMethodNotSupportedException extends RuntimeException {
Copy link

Choose a reason for hiding this comment

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

예외 👍

Comment on lines +20 to +22
public HttpHeaders() {
httpHeaders = new HashMap<>();
}
Copy link

Choose a reason for hiding this comment

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

기존 생성자를 활용해도 좋을 것 같아요~!

src/main/java/http/response/Response.java Outdated Show resolved Hide resolved
@hongsii hongsii merged commit ad512d2 into woowacourse:ksy90101 Oct 17, 2020
hongsii pushed a commit that referenced this pull request Nov 21, 2020
* [럿고] 1단계 - HTTP 웹 서버 구현 미션 제출합니다. (#101)

* docs: README.md 작성

* feat: URL추출 메서드 및 request header 출력 메서드 작성

* feat: /index.html로 접속했을 때 index.html 파일 응답 구현

* feat: 회원가입 시 회원에 대한 정보를 서버에 저장하는 로직 구현

* feat: post 처리 및 요청 값 객체 생성

* feat: 요구사항3 완료

* feat: 302 response 구현

* refactor: 요청에 따른 응답을 컨트롤러로 처리하도록 수정

Co-authored-by: 황준호 <42054054+hwanghe159@users.noreply.github.com>

* [럿고] 2단계 - HTTP 웹 서버 리팩토링 미션 제출합니다. (#149)

* [그래] 1단계 - HTTP 웹 서버 구현 미션 제출합니다. (#102)

* docs: README.md 작성

* feat: URL추출 메서드 및 request header 출력 메서드 작성

* feat: /index.html로 접속했을 때 index.html 파일 응답 구현

* feat: 회원가입 시 회원에 대한 정보를 서버에 저장하는 로직 구현

* feat: post 처리 및 요청 값 객체 생성

* feat: 요구사항3 완료

* feat: 302 response 구현

* refactor: 요청에 따른 응답을 컨트롤러로 처리하도록 수정

Co-authored-by: SeYun <ksy90101@naver.com>

* refactor: response 객체 생성

* refactor: header line 추가

* refactor: 필드명 변경, 디미터법칙 따르도록 수정

* refactor: 필드명 변경, RequestBody에 대한 예외처리, stringBuilder에서 append사용

* refactor: service 메서드 추상화

* refactor: QueryParams를 Request 내부로 이동, RequestUri, Path 생성

* feat: 쓰레드풀 적용

* refactor: / 경로 index.html 이동 controller 생성 및 전체 리팩토링

* test: Response에 대한 test작성

* test: controller 테스트 추가

* refactor: 파일 대문자 소문자로 변경

* test: 테스트 fail 해결, request, response파일 추가

* refactor: 지원하는 않는 메서드 예외 처리 리팩토링

* refactor: 리팩토링

- Header enum 삭제
- 컨트롤러 접근제어자 변경
- IllegalRequestException 메시지 변경
- 상수 이름 변경

* refactor: response test를 ByteArrayOutputStream으로 변경

Co-authored-by: 황준호 <42054054+hwanghe159@users.noreply.github.com>

* docs: 2단계, 3단계 요구사항 작성

* feat: 로그인 기능 구현

* feat: 로그인 시 user/list를 접속할 수 있게 기능 구현

* feat: 로그아웃, 세션 기능 구현

* feat: 피드백 반영

* refactor: 필요없는 파일 제거

* refactor: Handlebars 한번 초기화해서 재사용

* refactor: static변수 이름 변경, 인스턴스 변수 이름 변경

* refactor: 리팩토링

- 리퀘스트 바디 String -> Map 파싱 로직 캡슐화
- Database -> UserRepository 이름변경

* refactor: HttpHeaders 구성 로직 이동

* refactor: Cookie 생성

Co-authored-by: SeYun <53366407+ksy90101@users.noreply.github.com>
Co-authored-by: SeYun <ksy90101@naver.com>
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

3 participants