-
Notifications
You must be signed in to change notification settings - Fork 24
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주차 미션 / 서버 3조 김나은 #13
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.
고생하셨어요!! 코드를 보니 미션을 잘 수행해주신 것 같아요 👍
String body = request.getBody(); | ||
Map<String, String> params = HttpRequestUtils.parseQueryParameter(body); | ||
|
||
String userId = params.get(USER_ID.getKey()); | ||
String password = params.get(PASSWORD.getKey()); |
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.
파라미터를 파싱하는 걸 컨트롤러 대신에 httpRequest에서 처리하는 것도 괜찮을 것 같아요.
public static HttpRequest from(BufferedReader br) throws IOException { | ||
String startLine = br.readLine(); | ||
HttpRequestStartLine httpStartLine = HttpRequestStartLine.from(startLine); | ||
|
||
HttpRequestHeaders httpHeaders = HttpRequestHeaders.from(br); | ||
|
||
int contentLength = httpHeaders.getContentLength(); | ||
HttpRequestBody httpBody = HttpRequestBody.from(br, contentLength); | ||
|
||
return new HttpRequest(httpStartLine, httpHeaders, httpBody); | ||
} |
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.
여러 객체에 역할을 적절히 나누신 것 같네요!
|
||
import static http.HttpHeader.*; | ||
|
||
public class HttpRequestHeaders { |
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.
일급 컬렉션을 잘 사용하신 것 같아요
No description provided.