Skip to content

HTTP 웹 서버 구현#390

Open
hiro032 wants to merge 4 commits intonext-step:hiro032from
hiro032:step2_s
Open

HTTP 웹 서버 구현#390
hiro032 wants to merge 4 commits intonext-step:hiro032from
hiro032:step2_s

Conversation

@hiro032
Copy link

@hiro032 hiro032 commented Aug 25, 2022

안녕하세요 리뷰어님 늦게 PR 보냅니다.

테스트 코드를 거의 작성 못했는데 더 늦다가는 안될 것 같아서 1차 PR이라고 생각해 주시면 감사하겠습니다.

이후 과정에서 보완해 보겠습니다! 감사합니다. 🙂

Copy link

@sihoony sihoony left a comment

Choose a reason for hiding this comment

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

미션 수행 잘 해주셨습니다. 👍
몇가지 코멘트를 남겼으니 확인해주시고 궁금하신 점은 DM주세요!

좋은 하루 되세요! 😄

Comment on lines +5 to +19
public enum HttpContentType {
HTML(".html", "./templates", "text/html; charset=utf-8"),
JS(".js", "./static", "application/javascript; charset=utf-8"),
CSS(".css", "./static", "text/css,*/*;q=0.1"),
ICO(".ico", "./templates", "text/html;charset=utf-8"),
EOT(".eot", "./static", "application/vnd.ms-fontobject"),
SVG(".svg", "./static", "image/svg+xml"),
TTF(".ttf", "./static", "application/x-font-ttf"),
WOFF(".woff", "./static", "application/font-woff"),
WOFF2(".woff2", "./static", "application/font-woff2"),
PNG(".png", "./static", "image/png");

private final String type;
private final String path;
private final String contentType;
Copy link

Choose a reason for hiding this comment

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

ContentType과는 무관하게 Path와 Type이 있는것 같아요!
명확하게 분리해보는건 어떨까요? Path와 Type이 필요하다면 다른 명칭이 좋을 것 같습니다!^^

Comment on lines +27 to +32
response.addHeader("Set-Cookie", "logined=false");
response.redirect(StatusCode.FOUND, "/user/login_failed.html");
return;
}

response.addHeader("Set-Cookie", "logined=true");
Copy link

Choose a reason for hiding this comment

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

Cookie 정보를 관리하는 Class가 있다면 어떨까요?

List<String> headerValues = new ArrayList<>();
String header = bufferedReader.readLine();

while (header != null && !header.equals("")) {
Copy link

Choose a reason for hiding this comment

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

header != null 로인하여 !header.equals("")이 안전할 수 있지만 습관을 위해서 !"".equals(header) 는 어떨까요?

Comment on lines +6 to +12
public class AbstractController implements Controller {

@Override
public void process(HttpRequest request, HttpResponse response) {

}
}
Copy link

Choose a reason for hiding this comment

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

AbstractController를 만들었지만 사용하거나 구현되지가 않은것 같습니다.
몇가지 링크를 공유드립니다.

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.

2 participants