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주차 미션 / 서버 2조 황정안 #17

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jungan777
Copy link

현재 리팩토링 중 enum까지 완료하였고 계속 업로드 하겠습니다

Copy link

@twkwon0417 twkwon0417 left a comment

Choose a reason for hiding this comment

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

고생하셨습니다.
리팩토링하면 많은 도움 되니 하시길 강추 합니다!!!

if (line.equals("")) {
break;
}
if (line.startsWith("Cookie:")) {

Choose a reason for hiding this comment

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

만드신 enum 활용하면 좋을 거 같습니다.

Comment on lines +206 to +207
dos.writeBytes( CONTENT_TYPE.getHeader()+": "+TEXT_CSS.getHeader()+"\r\n");
dos.writeBytes( CONTENT_LENGTH.getHeader()+": "+ lengthOfBodyContent + "\r\n");

Choose a reason for hiding this comment

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

": " 이 반복 되는데 이친구들도 정리 할수 있을 거 같아요

boolean isLogined = false;
if (cookieHeader != null) {
Map<String, String> cookies = HttpRequestUtils.parseCookies(cookieHeader.split(": ")[1]);
isLogined = "true".equals(cookies.get("logined"));

Choose a reason for hiding this comment

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

여기도 만드신 enum 사용하실수 있어요!!

dos.writeBytes( SET_COOKIE.getHeader() +": " +"logined=true\r\n");

dos.writeBytes("\r\n");
dos.flush();

Choose a reason for hiding this comment

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

flush 후 stream 닫아 주세요!!
try-with-resource로 관리할수도 있습니다!

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