@@ -129,6 +129,69 @@ off=22 len=1 span[header_value]="1"
129129off=24 error code=3 reason="Missing expected LF after header value"
130130```
131131
132+ ### Bare CR after response line
133+
134+ <!-- meta={"type": "response"} -->
135+ ``` http
136+ HTTP/1.1 200 OK\rContent-Length: 0
137+
138+
139+ ```
140+
141+ ``` log
142+ off=0 message begin
143+ off=0 len=4 span[protocol]="HTTP"
144+ off=4 protocol complete
145+ off=5 len=3 span[version]="1.1"
146+ off=8 version complete
147+ off=13 len=2 span[status]="OK"
148+ off=16 error code=2 reason="Expected LF after CR"
149+ ```
150+
151+ ### Bare CR after response line (lenient)
152+
153+ <!-- meta={"type": "response-lenient-optional-lf-after-cr"} -->
154+ ``` http
155+ HTTP/1.1 200 OK\rContent-Length: 0
156+
157+
158+ ```
159+
160+ ``` log
161+ off=0 message begin
162+ off=0 len=4 span[protocol]="HTTP"
163+ off=4 protocol complete
164+ off=5 len=3 span[version]="1.1"
165+ off=8 version complete
166+ off=13 len=2 span[status]="OK"
167+ off=16 status complete
168+ off=16 len=14 span[header_field]="Content-Length"
169+ off=31 header_field complete
170+ off=32 len=1 span[header_value]="0"
171+ off=35 header_value complete
172+ off=37 headers complete status=200 v=1/1 flags=20 content_length=0
173+ off=37 message complete
174+ ```
175+
176+ ### Bare CR followed by CR after response line
177+
178+ <!-- meta={"type": "response"} -->
179+ ``` http
180+ HTTP/1.1 200 OK\r\rContent-Length: 4
181+
182+ Evil
183+ ```
184+
185+ ``` log
186+ off=0 message begin
187+ off=0 len=4 span[protocol]="HTTP"
188+ off=4 protocol complete
189+ off=5 len=3 span[version]="1.1"
190+ off=8 version complete
191+ off=13 len=2 span[status]="OK"
192+ off=16 error code=2 reason="Expected LF after CR"
193+ ```
194+
132195### Invalid HTTP version
133196
134197<!-- meta={"type": "response"} -->
@@ -313,4 +376,4 @@ off=35 headers complete status=200 v=1/1 flags=0 content_length=0
313376off=35 len=4 span[body]="BODY"
314377off=39 len=1 span[body]=lf
315378off=40 len=1 span[body]="\"
316- ```
379+ ```
0 commit comments