HTTP-message = start-line CRLF
*( field-line CRLF )
CRLF
[ message-body ]
Start-line = request-line / status-line
메시지는 start-line으로 시작한다. 메시지는 요청일 수 있고 응답일 수 있다.
서버는 요청만, 클라이언트는 응답만 받아 처리할 수 있다.
HTTP는 MIME(다목적 인터넷 메일 확장) 프로토콜을 사용한다. ****https://developer.mozilla.org/ko/docs/Web/HTTP/Basics_of_HTTP/MIME_types
수신자는 반드시 메시지를 옥텟 시퀀스(8비트 덩어리)로 구문을 분석해야한다. 그렇지 않으면 보안 취약성이 발생한다.
메시지를 추출하고 나서는 문자열 기반 구문 분석을 해도 된다.
Start-line 및 field의 종결 문자는 CRLF지만 수신자는 단일 LF을 종결 문자로 인식할 수 있다. (앞의 CR을 무시할 수 있다 (?))
발신자는 bare CR(LF가 바로 뒤에 오지 않는 CR문자)을 생성해서는 안된다. bare CR을 수신했다면 수신자는 유효하지 않게 처리하거나, space로 변환해서 처리해야 한다.
Older HTTP/1.0 user agent implementations might send an extra CRLF after a POST request as a workaround for some early server applications that failed to read message body content that was not terminated by a line-ending. An HTTP/1.1 user agent MUST NOT preface or follow a request with an extra CRLF. If terminating the request message body with a line-ending is desired, then the user agent MUST count the terminating CRLF octets as part of the message body length.
해석이 잘 안됩니다 ㅜ