Pairs 만들어서 코드 개선하기
Pairs pairs = HttpRequestUtils.pairsFrom(headerText);
builder.contentType(pairs1.getContentType());
public static Header from(String headerText) {
return HttpRequestUtils.createHeader(headerText);
}
Request Message:GET / HTTP/1.1
Host: localhost:8080
Connection: keep-alive
Cache-Control: max-age=0
sec-ch-ua: "Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"
sec-ch-ua-mobile: ?0
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Sec-Fetch-Site: none
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Accept-Encoding: gzip, deflate, br
Accept-Language: ko-KR,ko;q=0.9,en-US;q=0.8,en;q=0.7
Cookie: Idea-1c77831=5ced54c8-cabd-4355-ae5a-97b17f9d7443
Header에서 리턴하는 attribute와 statusLineAttribute를 한 꺼번에 묶어서 리턴하는건 어떨지 생각해보기