File tree Expand file tree Collapse file tree 3 files changed +53
-1
lines changed
Expand file tree Collapse file tree 3 files changed +53
-1
lines changed Original file line number Diff line number Diff line change @@ -782,7 +782,7 @@ export class HTTP {
782782 . otherwise ( n ( 'header_value_content_length_ws' ) ) ;
783783
784784 n ( 'header_value_content_length_ws' )
785- . match ( ' ' , n ( 'header_value_content_length_ws' ) )
785+ . match ( [ ' ' , '\t' ] , n ( 'header_value_content_length_ws' ) )
786786 . peek ( [ '\r' , '\n' ] ,
787787 this . setFlag ( FLAGS . CONTENT_LENGTH , 'header_value_otherwise' ) )
788788 . otherwise ( invalidContentLength ( 'Invalid character in Content-Length' ) ) ;
Original file line number Diff line number Diff line change @@ -314,6 +314,33 @@ off=39 header_value complete
314314off=41 headers complete method=3 v=1/1 flags=20 content_length=42
315315```
316316
317+ ### Tabs in ` Content-Length ` (surrounding)
318+
319+ <!-- meta={"type": "request"} -->
320+ ``` http
321+ POST / HTTP/1.1
322+ Content-Length:\t42\t
323+
324+
325+ ```
326+
327+ ``` log
328+ off=0 message begin
329+ off=0 len=4 span[method]="POST"
330+ off=4 method complete
331+ off=5 len=1 span[url]="/"
332+ off=7 url complete
333+ off=7 len=4 span[protocol]="HTTP"
334+ off=11 protocol complete
335+ off=12 len=3 span[version]="1.1"
336+ off=15 version complete
337+ off=17 len=14 span[header_field]="Content-Length"
338+ off=32 header_field complete
339+ off=33 len=5 span[header_value]="42\t "
340+ off=40 header_value complete
341+ off=42 headers complete method=3 v=1/1 flags=20 content_length=42
342+ ```
343+
317344### Spaces in ` Content-Length ` #2
318345
319346<!-- meta={"type": "request"} -->
Original file line number Diff line number Diff line change @@ -164,3 +164,28 @@ off=80 headers complete status=200 v=1/1 flags=20 content_length=456
164164off=80 skip body
165165off=80 message complete
166166```
167+
168+ ## Tabs in ` Content-Length ` (surrounding)
169+
170+ <!-- meta={"type": "response"} -->
171+ ``` http
172+ HTTP/1.1 200 OK
173+ Content-Length:\t42\t
174+
175+
176+ ```
177+
178+ ``` log
179+ off=0 message begin
180+ off=0 len=4 span[protocol]="HTTP"
181+ off=4 protocol complete
182+ off=5 len=3 span[version]="1.1"
183+ off=8 version complete
184+ off=13 len=2 span[status]="OK"
185+ off=17 status complete
186+ off=17 len=14 span[header_field]="Content-Length"
187+ off=32 header_field complete
188+ off=33 len=3 span[header_value]="42\t"
189+ off=38 header_value complete
190+ off=40 headers complete status=200 v=1/1 flags=20 content_length=42
191+ ```
You can’t perform that action at this time.
0 commit comments