-
Notifications
You must be signed in to change notification settings - Fork 23
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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:")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
만드신 enum 활용하면 좋을 거 같습니다.
dos.writeBytes( CONTENT_TYPE.getHeader()+": "+TEXT_CSS.getHeader()+"\r\n"); | ||
dos.writeBytes( CONTENT_LENGTH.getHeader()+": "+ lengthOfBodyContent + "\r\n"); |
There was a problem hiding this comment.
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")); |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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로 관리할수도 있습니다!
현재 리팩토링 중 enum까지 완료하였고 계속 업로드 하겠습니다