@@ -330,4 +330,76 @@ off=0 message begin
330330off=4 len=1 span[url]="/"
331331off=6 url complete
332332off=14 error code=9 reason="Invalid HTTP version"
333+ ```
334+
335+ ### Spaces before headers
336+
337+ <!-- meta={ "type": "request" } -->
338+
339+ ``` http
340+ POST /hello HTTP/1.1
341+ Host: localhost
342+ Foo: bar
343+ Content-Length: 38
344+
345+ GET /bye HTTP/1.1
346+ Host: localhost
347+
348+
349+ ```
350+
351+ ``` log
352+ off=0 message begin
353+ off=5 len=6 span[url]="/hello"
354+ off=12 url complete
355+ off=22 len=4 span[header_field]="Host"
356+ off=27 header_field complete
357+ off=28 len=9 span[header_value]="localhost"
358+ off=39 header_value complete
359+ off=39 len=3 span[header_field]="Foo"
360+ off=43 header_field complete
361+ off=44 len=3 span[header_value]="bar"
362+ off=49 error code=10 reason="Unexpected whitespace after header value"
363+ ```
364+
365+ ### Spaces before headers (lenient)
366+
367+ <!-- meta={ "type": "request-lenient-headers" } -->
368+
369+ ``` http
370+ POST /hello HTTP/1.1
371+ Host: localhost
372+ Foo: bar
373+ Content-Length: 38
374+
375+ GET /bye HTTP/1.1
376+ Host: localhost
377+
378+
379+ ```
380+
381+ ``` log
382+ off=0 message begin
383+ off=5 len=6 span[url]="/hello"
384+ off=12 url complete
385+ off=22 len=4 span[header_field]="Host"
386+ off=27 header_field complete
387+ off=28 len=9 span[header_value]="localhost"
388+ off=39 header_value complete
389+ off=39 len=3 span[header_field]="Foo"
390+ off=43 header_field complete
391+ off=44 len=3 span[header_value]="bar"
392+ off=49 len=19 span[header_value]=" Content-Length: 38"
393+ off=70 header_value complete
394+ off=72 headers complete method=3 v=1/1 flags=0 content_length=0
395+ off=72 message complete
396+ off=72 message begin
397+ off=76 len=4 span[url]="/bye"
398+ off=81 url complete
399+ off=91 len=4 span[header_field]="Host"
400+ off=96 header_field complete
401+ off=97 len=9 span[header_value]="localhost"
402+ off=108 header_value complete
403+ off=110 headers complete method=1 v=1/1 flags=0 content_length=0
404+ off=110 message complete
333405```
0 commit comments