| 1 |
Transfer-Encoding header |
| 2 |
======================== |
| 3 |
|
| 4 |
## `chunked` |
| 5 |
|
| 6 |
### Parsing and setting flag |
| 7 |
|
| 8 |
<!-- meta={"type": "request"} --> |
| 9 |
```http |
| 10 |
PUT /url HTTP/1.1 |
| 11 |
Transfer-Encoding: chunked |
| 12 |
|
| 13 |
|
| 14 |
``` |
| 15 |
|
| 16 |
```log |
| 17 |
off=0 message begin |
| 18 |
off=0 len=3 span[method]="PUT" |
| 19 |
off=3 method complete |
| 20 |
off=4 len=4 span[url]="/url" |
| 21 |
off=9 url complete |
| 22 |
off=14 len=3 span[version]="1.1" |
| 23 |
off=17 version complete |
| 24 |
off=19 len=17 span[header_field]="Transfer-Encoding" |
| 25 |
off=37 header_field complete |
| 26 |
off=38 len=7 span[header_value]="chunked" |
| 27 |
off=47 header_value complete |
| 28 |
off=49 headers complete method=4 v=1/1 flags=208 content_length=0 |
| 29 |
``` |
| 30 |
|
| 31 |
### Parse chunks with lowercase size |
| 32 |
|
| 33 |
<!-- meta={"type": "request"} --> |
| 34 |
```http |
| 35 |
PUT /url HTTP/1.1 |
| 36 |
Transfer-Encoding: chunked |
| 37 |
|
| 38 |
a |
| 39 |
0123456789 |
| 40 |
0 |
| 41 |
|
| 42 |
|
| 43 |
``` |
| 44 |
|
| 45 |
```log |
| 46 |
off=0 message begin |
| 47 |
off=0 len=3 span[method]="PUT" |
| 48 |
off=3 method complete |
| 49 |
off=4 len=4 span[url]="/url" |
| 50 |
off=9 url complete |
| 51 |
off=14 len=3 span[version]="1.1" |
| 52 |
off=17 version complete |
| 53 |
off=19 len=17 span[header_field]="Transfer-Encoding" |
| 54 |
off=37 header_field complete |
| 55 |
off=38 len=7 span[header_value]="chunked" |
| 56 |
off=47 header_value complete |
| 57 |
off=49 headers complete method=4 v=1/1 flags=208 content_length=0 |
| 58 |
off=52 chunk header len=10 |
| 59 |
off=52 len=10 span[body]="0123456789" |
| 60 |
off=64 chunk complete |
| 61 |
off=67 chunk header len=0 |
| 62 |
off=69 chunk complete |
| 63 |
off=69 message complete |
| 64 |
``` |
| 65 |
|
| 66 |
### Parse chunks with uppercase size |
| 67 |
|
| 68 |
<!-- meta={"type": "request"} --> |
| 69 |
```http |
| 70 |
PUT /url HTTP/1.1 |
| 71 |
Transfer-Encoding: chunked |
| 72 |
|
| 73 |
A |
| 74 |
0123456789 |
| 75 |
0 |
| 76 |
|
| 77 |
|
| 78 |
``` |
| 79 |
|
| 80 |
```log |
| 81 |
off=0 message begin |
| 82 |
off=0 len=3 span[method]="PUT" |
| 83 |
off=3 method complete |
| 84 |
off=4 len=4 span[url]="/url" |
| 85 |
off=9 url complete |
| 86 |
off=14 len=3 span[version]="1.1" |
| 87 |
off=17 version complete |
| 88 |
off=19 len=17 span[header_field]="Transfer-Encoding" |
| 89 |
off=37 header_field complete |
| 90 |
off=38 len=7 span[header_value]="chunked" |
| 91 |
off=47 header_value complete |
| 92 |
off=49 headers complete method=4 v=1/1 flags=208 content_length=0 |
| 93 |
off=52 chunk header len=10 |
| 94 |
off=52 len=10 span[body]="0123456789" |
| 95 |
off=64 chunk complete |
| 96 |
off=67 chunk header len=0 |
| 97 |
off=69 chunk complete |
| 98 |
off=69 message complete |
| 99 |
``` |
| 100 |
|
| 101 |
### POST with `Transfer-Encoding: chunked` |
| 102 |
|
| 103 |
<!-- meta={"type": "request"} --> |
| 104 |
```http |
| 105 |
POST /post_chunked_all_your_base HTTP/1.1 |
| 106 |
Transfer-Encoding: chunked |
| 107 |
|
| 108 |
1e |
| 109 |
all your base are belong to us |
| 110 |
0 |
| 111 |
|
| 112 |
|
| 113 |
``` |
| 114 |
|
| 115 |
```log |
| 116 |
off=0 message begin |
| 117 |
off=0 len=4 span[method]="POST" |
| 118 |
off=4 method complete |
| 119 |
off=5 len=27 span[url]="/post_chunked_all_your_base" |
| 120 |
off=33 url complete |
| 121 |
off=38 len=3 span[version]="1.1" |
| 122 |
off=41 version complete |
| 123 |
off=43 len=17 span[header_field]="Transfer-Encoding" |
| 124 |
off=61 header_field complete |
| 125 |
off=62 len=7 span[header_value]="chunked" |
| 126 |
off=71 header_value complete |
| 127 |
off=73 headers complete method=3 v=1/1 flags=208 content_length=0 |
| 128 |
off=77 chunk header len=30 |
| 129 |
off=77 len=30 span[body]="all your base are belong to us" |
| 130 |
off=109 chunk complete |
| 131 |
off=112 chunk header len=0 |
| 132 |
off=114 chunk complete |
| 133 |
off=114 message complete |
| 134 |
``` |
| 135 |
|
| 136 |
### Two chunks and triple zero prefixed end chunk |
| 137 |
|
| 138 |
<!-- meta={"type": "request"} --> |
| 139 |
```http |
| 140 |
POST /two_chunks_mult_zero_end HTTP/1.1 |
| 141 |
Transfer-Encoding: chunked |
| 142 |
|
| 143 |
5 |
| 144 |
hello |
| 145 |
6 |
| 146 |
world |
| 147 |
000 |
| 148 |
|
| 149 |
|
| 150 |
``` |
| 151 |
|
| 152 |
```log |
| 153 |
off=0 message begin |
| 154 |
off=0 len=4 span[method]="POST" |
| 155 |
off=4 method complete |
| 156 |
off=5 len=25 span[url]="/two_chunks_mult_zero_end" |
| 157 |
off=31 url complete |
| 158 |
off=36 len=3 span[version]="1.1" |
| 159 |
off=39 version complete |
| 160 |
off=41 len=17 span[header_field]="Transfer-Encoding" |
| 161 |
off=59 header_field complete |
| 162 |
off=60 len=7 span[header_value]="chunked" |
| 163 |
off=69 header_value complete |
| 164 |
off=71 headers complete method=3 v=1/1 flags=208 content_length=0 |
| 165 |
off=74 chunk header len=5 |
| 166 |
off=74 len=5 span[body]="hello" |
| 167 |
off=81 chunk complete |
| 168 |
off=84 chunk header len=6 |
| 169 |
off=84 len=6 span[body]=" world" |
| 170 |
off=92 chunk complete |
| 171 |
off=97 chunk header len=0 |
| 172 |
off=99 chunk complete |
| 173 |
off=99 message complete |
| 174 |
``` |
| 175 |
|
| 176 |
### Trailing headers |
| 177 |
|
| 178 |
<!-- meta={"type": "request"} --> |
| 179 |
```http |
| 180 |
POST /chunked_w_trailing_headers HTTP/1.1 |
| 181 |
Transfer-Encoding: chunked |
| 182 |
|
| 183 |
5 |
| 184 |
hello |
| 185 |
6 |
| 186 |
world |
| 187 |
0 |
| 188 |
Vary: * |
| 189 |
Content-Type: text/plain |
| 190 |
|
| 191 |
|
| 192 |
``` |
| 193 |
|
| 194 |
```log |
| 195 |
off=0 message begin |
| 196 |
off=0 len=4 span[method]="POST" |
| 197 |
off=4 method complete |
| 198 |
off=5 len=27 span[url]="/chunked_w_trailing_headers" |
| 199 |
off=33 url complete |
| 200 |
off=38 len=3 span[version]="1.1" |
| 201 |
off=41 version complete |
| 202 |
off=43 len=17 span[header_field]="Transfer-Encoding" |
| 203 |
off=61 header_field complete |
| 204 |
off=62 len=7 span[header_value]="chunked" |
| 205 |
off=71 header_value complete |
| 206 |
off=73 headers complete method=3 v=1/1 flags=208 content_length=0 |
| 207 |
off=76 chunk header len=5 |
| 208 |
off=76 len=5 span[body]="hello" |
| 209 |
off=83 chunk complete |
| 210 |
off=86 chunk header len=6 |
| 211 |
off=86 len=6 span[body]=" world" |
| 212 |
off=94 chunk complete |
| 213 |
off=97 chunk header len=0 |
| 214 |
off=97 len=4 span[header_field]="Vary" |
| 215 |
off=102 header_field complete |
| 216 |
off=103 len=1 span[header_value]="*" |
| 217 |
off=106 header_value complete |
| 218 |
off=106 len=12 span[header_field]="Content-Type" |
| 219 |
off=119 header_field complete |
| 220 |
off=120 len=10 span[header_value]="text/plain" |
| 221 |
off=132 header_value complete |
| 222 |
off=134 chunk complete |
| 223 |
off=134 message complete |
| 224 |
``` |
| 225 |
|
| 226 |
### Chunk extensions |
| 227 |
|
| 228 |
<!-- meta={"type": "request"} --> |
| 229 |
```http |
| 230 |
POST /chunked_w_unicorns_after_length HTTP/1.1 |
| 231 |
Transfer-Encoding: chunked |
| 232 |
|
| 233 |
5;ilovew3;somuchlove=aretheseparametersfor;another=withvalue |
| 234 |
hello |
| 235 |
6;blahblah;blah |
| 236 |
world |
| 237 |
0 |
| 238 |
|
| 239 |
``` |
| 240 |
|
| 241 |
```log |
| 242 |
off=0 message begin |
| 243 |
off=0 len=4 span[method]="POST" |
| 244 |
off=4 method complete |
| 245 |
off=5 len=32 span[url]="/chunked_w_unicorns_after_length" |
| 246 |
off=38 url complete |
| 247 |
off=43 len=3 span[version]="1.1" |
| 248 |
off=46 version complete |
| 249 |
off=48 len=17 span[header_field]="Transfer-Encoding" |
| 250 |
off=66 header_field complete |
| 251 |
off=67 len=7 span[header_value]="chunked" |
| 252 |
off=76 header_value complete |
| 253 |
off=78 headers complete method=3 v=1/1 flags=208 content_length=0 |
| 254 |
off=80 len=7 span[chunk_extension_name]="ilovew3" |
| 255 |
off=88 chunk_extension_name complete |
| 256 |
off=88 len=10 span[chunk_extension_name]="somuchlove" |
| 257 |
off=99 chunk_extension_name complete |
| 258 |
off=99 len=21 span[chunk_extension_value]="aretheseparametersfor" |
| 259 |
off=121 chunk_extension_value complete |
| 260 |
off=121 len=7 span[chunk_extension_name]="another" |
| 261 |
off=129 chunk_extension_name complete |
| 262 |
off=129 len=9 span[chunk_extension_value]="withvalue" |
| 263 |
off=139 chunk_extension_value complete |
| 264 |
off=140 chunk header len=5 |
| 265 |
off=140 len=5 span[body]="hello" |
| 266 |
off=147 chunk complete |
| 267 |
off=149 len=8 span[chunk_extension_name]="blahblah" |
| 268 |
off=158 chunk_extension_name complete |
| 269 |
off=158 len=4 span[chunk_extension_name]="blah" |
| 270 |
off=163 chunk_extension_name complete |
| 271 |
off=164 chunk header len=6 |
| 272 |
off=164 len=6 span[body]=" world" |
| 273 |
off=172 chunk complete |
| 274 |
off=175 chunk header len=0 |
| 275 |
``` |
| 276 |
|
| 277 |
### No semicolon before chunk extensions |
| 278 |
|
| 279 |
<!-- meta={"type": "request"} --> |
| 280 |
```http |
| 281 |
POST /chunked_w_unicorns_after_length HTTP/1.1 |
| 282 |
Host: localhost |
| 283 |
Transfer-encoding: chunked |
| 284 |
|
| 285 |
2 erfrferferf |
| 286 |
aa |
| 287 |
0 rrrr |
| 288 |
|
| 289 |
|
| 290 |
``` |
| 291 |
|
| 292 |
```log |
| 293 |
off=0 message begin |
| 294 |
off=0 len=4 span[method]="POST" |
| 295 |
off=4 method complete |
| 296 |
off=5 len=32 span[url]="/chunked_w_unicorns_after_length" |
| 297 |
off=38 url complete |
| 298 |
off=43 len=3 span[version]="1.1" |
| 299 |
off=46 version complete |
| 300 |
off=48 len=4 span[header_field]="Host" |
| 301 |
off=53 header_field complete |
| 302 |
off=54 len=9 span[header_value]="localhost" |
| 303 |
off=65 header_value complete |
| 304 |
off=65 len=17 span[header_field]="Transfer-encoding" |
| 305 |
off=83 header_field complete |
| 306 |
off=84 len=7 span[header_value]="chunked" |
| 307 |
off=93 header_value complete |
| 308 |
off=95 headers complete method=3 v=1/1 flags=208 content_length=0 |
| 309 |
off=97 error code=12 reason="Invalid character in chunk size" |
| 310 |
``` |
| 311 |
|
| 312 |
### No extension after semicolon |
| 313 |
|
| 314 |
<!-- meta={"type": "request"} --> |
| 315 |
```http |
| 316 |
POST /chunked_w_unicorns_after_length HTTP/1.1 |
| 317 |
Host: localhost |
| 318 |
Transfer-encoding: chunked |
| 319 |
|
| 320 |
2; |
| 321 |
aa |
| 322 |
0 |
| 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=32 span[url]="/chunked_w_unicorns_after_length" |
| 332 |
off=38 url complete |
| 333 |
off=43 len=3 span[version]="1.1" |
| 334 |
off=46 version complete |
| 335 |
off=48 len=4 span[header_field]="Host" |
| 336 |
off=53 header_field complete |
| 337 |
off=54 len=9 span[header_value]="localhost" |
| 338 |
off=65 header_value complete |
| 339 |
off=65 len=17 span[header_field]="Transfer-encoding" |
| 340 |
off=83 header_field complete |
| 341 |
off=84 len=7 span[header_value]="chunked" |
| 342 |
off=93 header_value complete |
| 343 |
off=95 headers complete method=3 v=1/1 flags=208 content_length=0 |
| 344 |
off=98 error code=2 reason="Invalid character in chunk extensions" |
| 345 |
``` |
| 346 |
|
| 347 |
|
| 348 |
### Chunk extensions quoting |
| 349 |
|
| 350 |
<!-- meta={"type": "request"} --> |
| 351 |
```http |
| 352 |
POST /chunked_w_unicorns_after_length HTTP/1.1 |
| 353 |
Transfer-Encoding: chunked |
| 354 |
|
| 355 |
5;ilovew3="I \"love\"; \\extensions\\";somuchlove="aretheseparametersfor";blah;foo=bar |
| 356 |
hello |
| 357 |
6;blahblah;blah |
| 358 |
world |
| 359 |
0 |
| 360 |
|
| 361 |
``` |
| 362 |
|
| 363 |
```log |
| 364 |
off=0 message begin |
| 365 |
off=0 len=4 span[method]="POST" |
| 366 |
off=4 method complete |
| 367 |
off=5 len=32 span[url]="/chunked_w_unicorns_after_length" |
| 368 |
off=38 url complete |
| 369 |
off=43 len=3 span[version]="1.1" |
| 370 |
off=46 version complete |
| 371 |
off=48 len=17 span[header_field]="Transfer-Encoding" |
| 372 |
off=66 header_field complete |
| 373 |
off=67 len=7 span[header_value]="chunked" |
| 374 |
off=76 header_value complete |
| 375 |
off=78 headers complete method=3 v=1/1 flags=208 content_length=0 |
| 376 |
off=80 len=7 span[chunk_extension_name]="ilovew3" |
| 377 |
off=88 chunk_extension_name complete |
| 378 |
off=88 len=28 span[chunk_extension_value]=""I \"love\"; \\extensions\\"" |
| 379 |
off=116 chunk_extension_value complete |
| 380 |
off=117 len=10 span[chunk_extension_name]="somuchlove" |
| 381 |
off=128 chunk_extension_name complete |
| 382 |
off=128 len=23 span[chunk_extension_value]=""aretheseparametersfor"" |
| 383 |
off=151 chunk_extension_value complete |
| 384 |
off=152 len=4 span[chunk_extension_name]="blah" |
| 385 |
off=157 chunk_extension_name complete |
| 386 |
off=157 len=3 span[chunk_extension_name]="foo" |
| 387 |
off=161 chunk_extension_name complete |
| 388 |
off=161 len=3 span[chunk_extension_value]="bar" |
| 389 |
off=165 chunk_extension_value complete |
| 390 |
off=166 chunk header len=5 |
| 391 |
off=166 len=5 span[body]="hello" |
| 392 |
off=173 chunk complete |
| 393 |
off=175 len=8 span[chunk_extension_name]="blahblah" |
| 394 |
off=184 chunk_extension_name complete |
| 395 |
off=184 len=4 span[chunk_extension_name]="blah" |
| 396 |
off=189 chunk_extension_name complete |
| 397 |
off=190 chunk header len=6 |
| 398 |
off=190 len=6 span[body]=" world" |
| 399 |
off=198 chunk complete |
| 400 |
off=201 chunk header len=0 |
| 401 |
``` |
| 402 |
|
| 403 |
|
| 404 |
### Unbalanced chunk extensions quoting |
| 405 |
|
| 406 |
<!-- meta={"type": "request"} --> |
| 407 |
```http |
| 408 |
POST /chunked_w_unicorns_after_length HTTP/1.1 |
| 409 |
Transfer-Encoding: chunked |
| 410 |
|
| 411 |
5;ilovew3="abc";somuchlove="def; ghi |
| 412 |
hello |
| 413 |
6;blahblah;blah |
| 414 |
world |
| 415 |
0 |
| 416 |
|
| 417 |
``` |
| 418 |
|
| 419 |
```log |
| 420 |
off=0 message begin |
| 421 |
off=0 len=4 span[method]="POST" |
| 422 |
off=4 method complete |
| 423 |
off=5 len=32 span[url]="/chunked_w_unicorns_after_length" |
| 424 |
off=38 url complete |
| 425 |
off=43 len=3 span[version]="1.1" |
| 426 |
off=46 version complete |
| 427 |
off=48 len=17 span[header_field]="Transfer-Encoding" |
| 428 |
off=66 header_field complete |
| 429 |
off=67 len=7 span[header_value]="chunked" |
| 430 |
off=76 header_value complete |
| 431 |
off=78 headers complete method=3 v=1/1 flags=208 content_length=0 |
| 432 |
off=80 len=7 span[chunk_extension_name]="ilovew3" |
| 433 |
off=88 chunk_extension_name complete |
| 434 |
off=88 len=5 span[chunk_extension_value]=""abc"" |
| 435 |
off=93 chunk_extension_value complete |
| 436 |
off=94 len=10 span[chunk_extension_name]="somuchlove" |
| 437 |
off=105 chunk_extension_name complete |
| 438 |
off=105 len=9 span[chunk_extension_value]=""def; ghi" |
| 439 |
off=115 error code=2 reason="Invalid character in chunk extensions quoted value" |
| 440 |
``` |
| 441 |
|
| 442 |
## Ignoring `pigeons` |
| 443 |
|
| 444 |
Requests cannot have invalid `Transfer-Encoding`. It is impossible to determine |
| 445 |
their body size. Not erroring would make HTTP smuggling attacks possible. |
| 446 |
|
| 447 |
<!-- meta={"type": "request", "noScan": true} --> |
| 448 |
```http |
| 449 |
PUT /url HTTP/1.1 |
| 450 |
Transfer-Encoding: pigeons |
| 451 |
|
| 452 |
|
| 453 |
``` |
| 454 |
|
| 455 |
```log |
| 456 |
off=0 message begin |
| 457 |
off=0 len=3 span[method]="PUT" |
| 458 |
off=3 method complete |
| 459 |
off=4 len=4 span[url]="/url" |
| 460 |
off=9 url complete |
| 461 |
off=14 len=3 span[version]="1.1" |
| 462 |
off=17 version complete |
| 463 |
off=19 len=17 span[header_field]="Transfer-Encoding" |
| 464 |
off=37 header_field complete |
| 465 |
off=38 len=7 span[header_value]="pigeons" |
| 466 |
off=47 header_value complete |
| 467 |
off=49 headers complete method=4 v=1/1 flags=200 content_length=0 |
| 468 |
off=49 error code=15 reason="Request has invalid `Transfer-Encoding`" |
| 469 |
``` |
| 470 |
|
| 471 |
## POST with `Transfer-Encoding` and `Content-Length` |
| 472 |
|
| 473 |
<!-- meta={"type": "request"} --> |
| 474 |
```http |
| 475 |
POST /post_identity_body_world?q=search#hey HTTP/1.1 |
| 476 |
Accept: */* |
| 477 |
Transfer-Encoding: identity |
| 478 |
Content-Length: 5 |
| 479 |
|
| 480 |
World |
| 481 |
``` |
| 482 |
|
| 483 |
```log |
| 484 |
off=0 message begin |
| 485 |
off=0 len=4 span[method]="POST" |
| 486 |
off=4 method complete |
| 487 |
off=5 len=38 span[url]="/post_identity_body_world?q=search#hey" |
| 488 |
off=44 url complete |
| 489 |
off=49 len=3 span[version]="1.1" |
| 490 |
off=52 version complete |
| 491 |
off=54 len=6 span[header_field]="Accept" |
| 492 |
off=61 header_field complete |
| 493 |
off=62 len=3 span[header_value]="*/*" |
| 494 |
off=67 header_value complete |
| 495 |
off=67 len=17 span[header_field]="Transfer-Encoding" |
| 496 |
off=85 header_field complete |
| 497 |
off=86 len=8 span[header_value]="identity" |
| 498 |
off=96 header_value complete |
| 499 |
off=96 len=14 span[header_field]="Content-Length" |
| 500 |
off=111 header_field complete |
| 501 |
off=111 error code=11 reason="Content-Length can't be present with Transfer-Encoding" |
| 502 |
``` |
| 503 |
|
| 504 |
## POST with `Transfer-Encoding` and `Content-Length` (lenient) |
| 505 |
|
| 506 |
TODO(indutny): should we allow it even in lenient mode? (Consider disabling |
| 507 |
this). |
| 508 |
|
| 509 |
NOTE: `Content-Length` is ignored when `Transfer-Encoding` is present. Messages |
| 510 |
(in lenient mode) are read until EOF. |
| 511 |
|
| 512 |
<!-- meta={"type": "request-lenient-chunked-length"} --> |
| 513 |
```http |
| 514 |
POST /post_identity_body_world?q=search#hey HTTP/1.1 |
| 515 |
Accept: */* |
| 516 |
Transfer-Encoding: identity |
| 517 |
Content-Length: 1 |
| 518 |
|
| 519 |
World |
| 520 |
``` |
| 521 |
|
| 522 |
```log |
| 523 |
off=0 message begin |
| 524 |
off=0 len=4 span[method]="POST" |
| 525 |
off=4 method complete |
| 526 |
off=5 len=38 span[url]="/post_identity_body_world?q=search#hey" |
| 527 |
off=44 url complete |
| 528 |
off=49 len=3 span[version]="1.1" |
| 529 |
off=52 version complete |
| 530 |
off=54 len=6 span[header_field]="Accept" |
| 531 |
off=61 header_field complete |
| 532 |
off=62 len=3 span[header_value]="*/*" |
| 533 |
off=67 header_value complete |
| 534 |
off=67 len=17 span[header_field]="Transfer-Encoding" |
| 535 |
off=85 header_field complete |
| 536 |
off=86 len=8 span[header_value]="identity" |
| 537 |
off=96 header_value complete |
| 538 |
off=96 len=14 span[header_field]="Content-Length" |
| 539 |
off=111 header_field complete |
| 540 |
off=112 len=1 span[header_value]="1" |
| 541 |
off=115 header_value complete |
| 542 |
off=117 headers complete method=3 v=1/1 flags=220 content_length=1 |
| 543 |
off=117 len=5 span[body]="World" |
| 544 |
``` |
| 545 |
|
| 546 |
## POST with empty `Transfer-Encoding` and `Content-Length` (lenient) |
| 547 |
|
| 548 |
<!-- meta={"type": "request"} --> |
| 549 |
```http |
| 550 |
POST / HTTP/1.1 |
| 551 |
Host: foo |
| 552 |
Content-Length: 10 |
| 553 |
Transfer-Encoding: |
| 554 |
Transfer-Encoding: |
| 555 |
Transfer-Encoding: |
| 556 |
|
| 557 |
2 |
| 558 |
AA |
| 559 |
0 |
| 560 |
``` |
| 561 |
|
| 562 |
```log |
| 563 |
off=0 message begin |
| 564 |
off=0 len=4 span[method]="POST" |
| 565 |
off=4 method complete |
| 566 |
off=5 len=1 span[url]="/" |
| 567 |
off=7 url complete |
| 568 |
off=12 len=3 span[version]="1.1" |
| 569 |
off=15 version complete |
| 570 |
off=17 len=4 span[header_field]="Host" |
| 571 |
off=22 header_field complete |
| 572 |
off=23 len=3 span[header_value]="foo" |
| 573 |
off=28 header_value complete |
| 574 |
off=28 len=14 span[header_field]="Content-Length" |
| 575 |
off=43 header_field complete |
| 576 |
off=44 len=2 span[header_value]="10" |
| 577 |
off=48 header_value complete |
| 578 |
off=48 len=17 span[header_field]="Transfer-Encoding" |
| 579 |
off=66 header_field complete |
| 580 |
off=66 error code=15 reason="Transfer-Encoding can't be present with Content-Length" |
| 581 |
``` |
| 582 |
|
| 583 |
## POST with `chunked` before other transfer coding names |
| 584 |
|
| 585 |
<!-- meta={"type": "request", "noScan": true} --> |
| 586 |
```http |
| 587 |
POST /post_identity_body_world?q=search#hey HTTP/1.1 |
| 588 |
Accept: */* |
| 589 |
Transfer-Encoding: chunked, deflate |
| 590 |
|
| 591 |
World |
| 592 |
``` |
| 593 |
|
| 594 |
```log |
| 595 |
off=0 message begin |
| 596 |
off=0 len=4 span[method]="POST" |
| 597 |
off=4 method complete |
| 598 |
off=5 len=38 span[url]="/post_identity_body_world?q=search#hey" |
| 599 |
off=44 url complete |
| 600 |
off=49 len=3 span[version]="1.1" |
| 601 |
off=52 version complete |
| 602 |
off=54 len=6 span[header_field]="Accept" |
| 603 |
off=61 header_field complete |
| 604 |
off=62 len=3 span[header_value]="*/*" |
| 605 |
off=67 header_value complete |
| 606 |
off=67 len=17 span[header_field]="Transfer-Encoding" |
| 607 |
off=85 header_field complete |
| 608 |
off=86 len=7 span[header_value]="chunked" |
| 609 |
off=94 error code=15 reason="Invalid `Transfer-Encoding` header value" |
| 610 |
``` |
| 611 |
|
| 612 |
## POST with `chunked` and duplicate transfer-encoding |
| 613 |
|
| 614 |
<!-- meta={"type": "request", "noScan": true} --> |
| 615 |
```http |
| 616 |
POST /post_identity_body_world?q=search#hey HTTP/1.1 |
| 617 |
Accept: */* |
| 618 |
Transfer-Encoding: chunked |
| 619 |
Transfer-Encoding: deflate |
| 620 |
|
| 621 |
World |
| 622 |
``` |
| 623 |
|
| 624 |
```log |
| 625 |
off=0 message begin |
| 626 |
off=0 len=4 span[method]="POST" |
| 627 |
off=4 method complete |
| 628 |
off=5 len=38 span[url]="/post_identity_body_world?q=search#hey" |
| 629 |
off=44 url complete |
| 630 |
off=49 len=3 span[version]="1.1" |
| 631 |
off=52 version complete |
| 632 |
off=54 len=6 span[header_field]="Accept" |
| 633 |
off=61 header_field complete |
| 634 |
off=62 len=3 span[header_value]="*/*" |
| 635 |
off=67 header_value complete |
| 636 |
off=67 len=17 span[header_field]="Transfer-Encoding" |
| 637 |
off=85 header_field complete |
| 638 |
off=86 len=7 span[header_value]="chunked" |
| 639 |
off=95 header_value complete |
| 640 |
off=95 len=17 span[header_field]="Transfer-Encoding" |
| 641 |
off=113 header_field complete |
| 642 |
off=114 len=0 span[header_value]="" |
| 643 |
off=115 error code=15 reason="Invalid `Transfer-Encoding` header value" |
| 644 |
``` |
| 645 |
|
| 646 |
## POST with `chunked` before other transfer-coding (lenient) |
| 647 |
|
| 648 |
<!-- meta={"type": "request-lenient-transfer-encoding"} --> |
| 649 |
```http |
| 650 |
POST /post_identity_body_world?q=search#hey HTTP/1.1 |
| 651 |
Accept: */* |
| 652 |
Transfer-Encoding: chunked, deflate |
| 653 |
|
| 654 |
World |
| 655 |
``` |
| 656 |
|
| 657 |
```log |
| 658 |
off=0 message begin |
| 659 |
off=0 len=4 span[method]="POST" |
| 660 |
off=4 method complete |
| 661 |
off=5 len=38 span[url]="/post_identity_body_world?q=search#hey" |
| 662 |
off=44 url complete |
| 663 |
off=49 len=3 span[version]="1.1" |
| 664 |
off=52 version complete |
| 665 |
off=54 len=6 span[header_field]="Accept" |
| 666 |
off=61 header_field complete |
| 667 |
off=62 len=3 span[header_value]="*/*" |
| 668 |
off=67 header_value complete |
| 669 |
off=67 len=17 span[header_field]="Transfer-Encoding" |
| 670 |
off=85 header_field complete |
| 671 |
off=86 len=16 span[header_value]="chunked, deflate" |
| 672 |
off=104 header_value complete |
| 673 |
off=106 headers complete method=3 v=1/1 flags=200 content_length=0 |
| 674 |
off=106 len=5 span[body]="World" |
| 675 |
``` |
| 676 |
|
| 677 |
## POST with `chunked` and duplicate transfer-encoding (lenient) |
| 678 |
|
| 679 |
<!-- meta={"type": "request-lenient-transfer-encoding"} --> |
| 680 |
```http |
| 681 |
POST /post_identity_body_world?q=search#hey HTTP/1.1 |
| 682 |
Accept: */* |
| 683 |
Transfer-Encoding: chunked |
| 684 |
Transfer-Encoding: deflate |
| 685 |
|
| 686 |
World |
| 687 |
``` |
| 688 |
|
| 689 |
```log |
| 690 |
off=0 message begin |
| 691 |
off=0 len=4 span[method]="POST" |
| 692 |
off=4 method complete |
| 693 |
off=5 len=38 span[url]="/post_identity_body_world?q=search#hey" |
| 694 |
off=44 url complete |
| 695 |
off=49 len=3 span[version]="1.1" |
| 696 |
off=52 version complete |
| 697 |
off=54 len=6 span[header_field]="Accept" |
| 698 |
off=61 header_field complete |
| 699 |
off=62 len=3 span[header_value]="*/*" |
| 700 |
off=67 header_value complete |
| 701 |
off=67 len=17 span[header_field]="Transfer-Encoding" |
| 702 |
off=85 header_field complete |
| 703 |
off=86 len=7 span[header_value]="chunked" |
| 704 |
off=95 header_value complete |
| 705 |
off=95 len=17 span[header_field]="Transfer-Encoding" |
| 706 |
off=113 header_field complete |
| 707 |
off=114 len=7 span[header_value]="deflate" |
| 708 |
off=123 header_value complete |
| 709 |
off=125 headers complete method=3 v=1/1 flags=200 content_length=0 |
| 710 |
off=125 len=5 span[body]="World" |
| 711 |
``` |
| 712 |
|
| 713 |
## POST with `chunked` as last transfer-encoding |
| 714 |
|
| 715 |
<!-- meta={"type": "request"} --> |
| 716 |
```http |
| 717 |
POST /post_identity_body_world?q=search#hey HTTP/1.1 |
| 718 |
Accept: */* |
| 719 |
Transfer-Encoding: deflate, chunked |
| 720 |
|
| 721 |
5 |
| 722 |
World |
| 723 |
0 |
| 724 |
|
| 725 |
|
| 726 |
``` |
| 727 |
|
| 728 |
```log |
| 729 |
off=0 message begin |
| 730 |
off=0 len=4 span[method]="POST" |
| 731 |
off=4 method complete |
| 732 |
off=5 len=38 span[url]="/post_identity_body_world?q=search#hey" |
| 733 |
off=44 url complete |
| 734 |
off=49 len=3 span[version]="1.1" |
| 735 |
off=52 version complete |
| 736 |
off=54 len=6 span[header_field]="Accept" |
| 737 |
off=61 header_field complete |
| 738 |
off=62 len=3 span[header_value]="*/*" |
| 739 |
off=67 header_value complete |
| 740 |
off=67 len=17 span[header_field]="Transfer-Encoding" |
| 741 |
off=85 header_field complete |
| 742 |
off=86 len=16 span[header_value]="deflate, chunked" |
| 743 |
off=104 header_value complete |
| 744 |
off=106 headers complete method=3 v=1/1 flags=208 content_length=0 |
| 745 |
off=109 chunk header len=5 |
| 746 |
off=109 len=5 span[body]="World" |
| 747 |
off=116 chunk complete |
| 748 |
off=119 chunk header len=0 |
| 749 |
off=121 chunk complete |
| 750 |
off=121 message complete |
| 751 |
``` |
| 752 |
|
| 753 |
## POST with `chunked` as last transfer-encoding (multiple headers) |
| 754 |
|
| 755 |
<!-- meta={"type": "request"} --> |
| 756 |
```http |
| 757 |
POST /post_identity_body_world?q=search#hey HTTP/1.1 |
| 758 |
Accept: */* |
| 759 |
Transfer-Encoding: deflate |
| 760 |
Transfer-Encoding: chunked |
| 761 |
|
| 762 |
5 |
| 763 |
World |
| 764 |
0 |
| 765 |
|
| 766 |
|
| 767 |
``` |
| 768 |
|
| 769 |
```log |
| 770 |
off=0 message begin |
| 771 |
off=0 len=4 span[method]="POST" |
| 772 |
off=4 method complete |
| 773 |
off=5 len=38 span[url]="/post_identity_body_world?q=search#hey" |
| 774 |
off=44 url complete |
| 775 |
off=49 len=3 span[version]="1.1" |
| 776 |
off=52 version complete |
| 777 |
off=54 len=6 span[header_field]="Accept" |
| 778 |
off=61 header_field complete |
| 779 |
off=62 len=3 span[header_value]="*/*" |
| 780 |
off=67 header_value complete |
| 781 |
off=67 len=17 span[header_field]="Transfer-Encoding" |
| 782 |
off=85 header_field complete |
| 783 |
off=86 len=7 span[header_value]="deflate" |
| 784 |
off=95 header_value complete |
| 785 |
off=95 len=17 span[header_field]="Transfer-Encoding" |
| 786 |
off=113 header_field complete |
| 787 |
off=114 len=7 span[header_value]="chunked" |
| 788 |
off=123 header_value complete |
| 789 |
off=125 headers complete method=3 v=1/1 flags=208 content_length=0 |
| 790 |
off=128 chunk header len=5 |
| 791 |
off=128 len=5 span[body]="World" |
| 792 |
off=135 chunk complete |
| 793 |
off=138 chunk header len=0 |
| 794 |
off=140 chunk complete |
| 795 |
off=140 message complete |
| 796 |
``` |
| 797 |
|
| 798 |
## POST with `chunkedchunked` as transfer-encoding |
| 799 |
|
| 800 |
<!-- meta={"type": "request"} --> |
| 801 |
```http |
| 802 |
POST /post_identity_body_world?q=search#hey HTTP/1.1 |
| 803 |
Accept: */* |
| 804 |
Transfer-Encoding: chunkedchunked |
| 805 |
|
| 806 |
5 |
| 807 |
World |
| 808 |
0 |
| 809 |
|
| 810 |
|
| 811 |
``` |
| 812 |
|
| 813 |
```log |
| 814 |
off=0 message begin |
| 815 |
off=0 len=4 span[method]="POST" |
| 816 |
off=4 method complete |
| 817 |
off=5 len=38 span[url]="/post_identity_body_world?q=search#hey" |
| 818 |
off=44 url complete |
| 819 |
off=49 len=3 span[version]="1.1" |
| 820 |
off=52 version complete |
| 821 |
off=54 len=6 span[header_field]="Accept" |
| 822 |
off=61 header_field complete |
| 823 |
off=62 len=3 span[header_value]="*/*" |
| 824 |
off=67 header_value complete |
| 825 |
off=67 len=17 span[header_field]="Transfer-Encoding" |
| 826 |
off=85 header_field complete |
| 827 |
off=86 len=14 span[header_value]="chunkedchunked" |
| 828 |
off=102 header_value complete |
| 829 |
off=104 headers complete method=3 v=1/1 flags=200 content_length=0 |
| 830 |
off=104 error code=15 reason="Request has invalid `Transfer-Encoding`" |
| 831 |
``` |
| 832 |
|
| 833 |
## Missing last-chunk |
| 834 |
|
| 835 |
<!-- meta={"type": "request"} --> |
| 836 |
```http |
| 837 |
PUT /url HTTP/1.1 |
| 838 |
Transfer-Encoding: chunked |
| 839 |
|
| 840 |
3 |
| 841 |
foo |
| 842 |
|
| 843 |
|
| 844 |
``` |
| 845 |
|
| 846 |
```log |
| 847 |
off=0 message begin |
| 848 |
off=0 len=3 span[method]="PUT" |
| 849 |
off=3 method complete |
| 850 |
off=4 len=4 span[url]="/url" |
| 851 |
off=9 url complete |
| 852 |
off=14 len=3 span[version]="1.1" |
| 853 |
off=17 version complete |
| 854 |
off=19 len=17 span[header_field]="Transfer-Encoding" |
| 855 |
off=37 header_field complete |
| 856 |
off=38 len=7 span[header_value]="chunked" |
| 857 |
off=47 header_value complete |
| 858 |
off=49 headers complete method=4 v=1/1 flags=208 content_length=0 |
| 859 |
off=52 chunk header len=3 |
| 860 |
off=52 len=3 span[body]="foo" |
| 861 |
off=57 chunk complete |
| 862 |
off=57 error code=12 reason="Invalid character in chunk size" |
| 863 |
``` |
| 864 |
|
| 865 |
## Validate chunk parameters |
| 866 |
|
| 867 |
<!-- meta={"type": "request" } --> |
| 868 |
```http |
| 869 |
PUT /url HTTP/1.1 |
| 870 |
Transfer-Encoding: chunked |
| 871 |
|
| 872 |
3 \n \r\n\ |
| 873 |
foo |
| 874 |
|
| 875 |
|
| 876 |
``` |
| 877 |
|
| 878 |
```log |
| 879 |
off=0 message begin |
| 880 |
off=0 len=3 span[method]="PUT" |
| 881 |
off=3 method complete |
| 882 |
off=4 len=4 span[url]="/url" |
| 883 |
off=9 url complete |
| 884 |
off=14 len=3 span[version]="1.1" |
| 885 |
off=17 version complete |
| 886 |
off=19 len=17 span[header_field]="Transfer-Encoding" |
| 887 |
off=37 header_field complete |
| 888 |
off=38 len=7 span[header_value]="chunked" |
| 889 |
off=47 header_value complete |
| 890 |
off=49 headers complete method=4 v=1/1 flags=208 content_length=0 |
| 891 |
off=51 error code=12 reason="Invalid character in chunk size" |
| 892 |
``` |
| 893 |
|
| 894 |
## Invalid OBS fold after chunked value |
| 895 |
|
| 896 |
<!-- meta={"type": "request-lenient-headers" } --> |
| 897 |
```http |
| 898 |
PUT /url HTTP/1.1 |
| 899 |
Transfer-Encoding: chunked |
| 900 |
abc |
| 901 |
|
| 902 |
5 |
| 903 |
World |
| 904 |
0 |
| 905 |
|
| 906 |
|
| 907 |
``` |
| 908 |
|
| 909 |
```log |
| 910 |
off=0 message begin |
| 911 |
off=0 len=3 span[method]="PUT" |
| 912 |
off=3 method complete |
| 913 |
off=4 len=4 span[url]="/url" |
| 914 |
off=9 url complete |
| 915 |
off=14 len=3 span[version]="1.1" |
| 916 |
off=17 version complete |
| 917 |
off=19 len=17 span[header_field]="Transfer-Encoding" |
| 918 |
off=37 header_field complete |
| 919 |
off=38 len=7 span[header_value]="chunked" |
| 920 |
off=47 len=5 span[header_value]=" abc" |
| 921 |
off=54 header_value complete |
| 922 |
off=56 headers complete method=4 v=1/1 flags=200 content_length=0 |
| 923 |
off=56 error code=15 reason="Request has invalid `Transfer-Encoding`" |
| 924 |
``` |
| 925 |
|
| 926 |
### Chunk header not terminated by CRLF |
| 927 |
|
| 928 |
<!-- meta={"type": "request" } --> |
| 929 |
|
| 930 |
```http |
| 931 |
GET / HTTP/1.1 |
| 932 |
Host: a |
| 933 |
Connection: close |
| 934 |
Transfer-Encoding: chunked |
| 935 |
|
| 936 |
5\r\r;ABCD |
| 937 |
34 |
| 938 |
E |
| 939 |
0 |
| 940 |
|
| 941 |
GET / HTTP/1.1 |
| 942 |
Host: a |
| 943 |
Content-Length: 5 |
| 944 |
|
| 945 |
0 |
| 946 |
|
| 947 |
``` |
| 948 |
|
| 949 |
```log |
| 950 |
off=0 message begin |
| 951 |
off=0 len=3 span[method]="GET" |
| 952 |
off=3 method complete |
| 953 |
off=4 len=1 span[url]="/" |
| 954 |
off=6 url complete |
| 955 |
off=11 len=3 span[version]="1.1" |
| 956 |
off=14 version complete |
| 957 |
off=16 len=4 span[header_field]="Host" |
| 958 |
off=21 header_field complete |
| 959 |
off=22 len=1 span[header_value]="a" |
| 960 |
off=25 header_value complete |
| 961 |
off=25 len=10 span[header_field]="Connection" |
| 962 |
off=36 header_field complete |
| 963 |
off=37 len=6 span[header_value]="close " |
| 964 |
off=45 header_value complete |
| 965 |
off=45 len=17 span[header_field]="Transfer-Encoding" |
| 966 |
off=63 header_field complete |
| 967 |
off=64 len=8 span[header_value]="chunked " |
| 968 |
off=74 header_value complete |
| 969 |
off=76 headers complete method=1 v=1/1 flags=20a content_length=0 |
| 970 |
off=78 error code=2 reason="Expected LF after chunk size" |
| 971 |
``` |
| 972 |
|
| 973 |
### Chunk header not terminated by CRLF (lenient) |
| 974 |
|
| 975 |
<!-- meta={"type": "request-lenient-optional-lf-after-cr" } --> |
| 976 |
|
| 977 |
```http |
| 978 |
GET / HTTP/1.1 |
| 979 |
Host: a |
| 980 |
Connection: close |
| 981 |
Transfer-Encoding: chunked |
| 982 |
|
| 983 |
6\r\r;ABCD |
| 984 |
33 |
| 985 |
E |
| 986 |
0 |
| 987 |
|
| 988 |
GET / HTTP/1.1 |
| 989 |
Host: a |
| 990 |
Content-Length: 5 |
| 991 |
0 |
| 992 |
|
| 993 |
|
| 994 |
``` |
| 995 |
|
| 996 |
```log |
| 997 |
off=0 message begin |
| 998 |
off=0 len=3 span[method]="GET" |
| 999 |
off=3 method complete |
| 1000 |
off=4 len=1 span[url]="/" |
| 1001 |
off=6 url complete |
| 1002 |
off=11 len=3 span[version]="1.1" |
| 1003 |
off=14 version complete |
| 1004 |
off=16 len=4 span[header_field]="Host" |
| 1005 |
off=21 header_field complete |
| 1006 |
off=22 len=1 span[header_value]="a" |
| 1007 |
off=25 header_value complete |
| 1008 |
off=25 len=10 span[header_field]="Connection" |
| 1009 |
off=36 header_field complete |
| 1010 |
off=37 len=6 span[header_value]="close " |
| 1011 |
off=45 header_value complete |
| 1012 |
off=45 len=17 span[header_field]="Transfer-Encoding" |
| 1013 |
off=63 header_field complete |
| 1014 |
off=64 len=8 span[header_value]="chunked " |
| 1015 |
off=74 header_value complete |
| 1016 |
off=76 headers complete method=1 v=1/1 flags=20a content_length=0 |
| 1017 |
off=78 chunk header len=6 |
| 1018 |
off=78 len=1 span[body]=cr |
| 1019 |
off=79 len=5 span[body]=";ABCD" |
| 1020 |
off=86 chunk complete |
| 1021 |
off=90 chunk header len=51 |
| 1022 |
off=90 len=1 span[body]="E" |
| 1023 |
off=91 len=1 span[body]=cr |
| 1024 |
off=92 len=1 span[body]=lf |
| 1025 |
off=93 len=1 span[body]="0" |
| 1026 |
off=94 len=1 span[body]=cr |
| 1027 |
off=95 len=1 span[body]=lf |
| 1028 |
off=96 len=1 span[body]=cr |
| 1029 |
off=97 len=1 span[body]=lf |
| 1030 |
off=98 len=15 span[body]="GET / HTTP/1.1 " |
| 1031 |
off=113 len=1 span[body]=cr |
| 1032 |
off=114 len=1 span[body]=lf |
| 1033 |
off=115 len=7 span[body]="Host: a" |
| 1034 |
off=122 len=1 span[body]=cr |
| 1035 |
off=123 len=1 span[body]=lf |
| 1036 |
off=124 len=17 span[body]="Content-Length: 5" |
| 1037 |
off=143 chunk complete |
| 1038 |
off=146 chunk header len=0 |
| 1039 |
off=148 chunk complete |
| 1040 |
off=148 message complete |
| 1041 |
``` |
| 1042 |
|
| 1043 |
### Chunk data not terminated by CRLF |
| 1044 |
|
| 1045 |
<!-- meta={"type": "request" } --> |
| 1046 |
|
| 1047 |
```http |
| 1048 |
GET / HTTP/1.1 |
| 1049 |
Host: a |
| 1050 |
Connection: close |
| 1051 |
Transfer-Encoding: chunked |
| 1052 |
|
| 1053 |
5 |
| 1054 |
ABCDE0 |
| 1055 |
|
| 1056 |
``` |
| 1057 |
|
| 1058 |
```log |
| 1059 |
off=0 message begin |
| 1060 |
off=0 len=3 span[method]="GET" |
| 1061 |
off=3 method complete |
| 1062 |
off=4 len=1 span[url]="/" |
| 1063 |
off=6 url complete |
| 1064 |
off=11 len=3 span[version]="1.1" |
| 1065 |
off=14 version complete |
| 1066 |
off=16 len=4 span[header_field]="Host" |
| 1067 |
off=21 header_field complete |
| 1068 |
off=22 len=1 span[header_value]="a" |
| 1069 |
off=25 header_value complete |
| 1070 |
off=25 len=10 span[header_field]="Connection" |
| 1071 |
off=36 header_field complete |
| 1072 |
off=37 len=6 span[header_value]="close " |
| 1073 |
off=45 header_value complete |
| 1074 |
off=45 len=17 span[header_field]="Transfer-Encoding" |
| 1075 |
off=63 header_field complete |
| 1076 |
off=64 len=8 span[header_value]="chunked " |
| 1077 |
off=74 header_value complete |
| 1078 |
off=76 headers complete method=1 v=1/1 flags=20a content_length=0 |
| 1079 |
off=79 chunk header len=5 |
| 1080 |
off=79 len=5 span[body]="ABCDE" |
| 1081 |
off=84 error code=2 reason="Expected LF after chunk data" |
| 1082 |
``` |
| 1083 |
|
| 1084 |
### Chunk data not terminated by CRLF (lenient) |
| 1085 |
|
| 1086 |
<!-- meta={"type": "request-lenient-optional-crlf-after-chunk" } --> |
| 1087 |
|
| 1088 |
```http |
| 1089 |
GET / HTTP/1.1 |
| 1090 |
Host: a |
| 1091 |
Connection: close |
| 1092 |
Transfer-Encoding: chunked |
| 1093 |
|
| 1094 |
5 |
| 1095 |
ABCDE0 |
| 1096 |
|
| 1097 |
``` |
| 1098 |
|
| 1099 |
```log |
| 1100 |
off=0 message begin |
| 1101 |
off=0 len=3 span[method]="GET" |
| 1102 |
off=3 method complete |
| 1103 |
off=4 len=1 span[url]="/" |
| 1104 |
off=6 url complete |
| 1105 |
off=11 len=3 span[version]="1.1" |
| 1106 |
off=14 version complete |
| 1107 |
off=16 len=4 span[header_field]="Host" |
| 1108 |
off=21 header_field complete |
| 1109 |
off=22 len=1 span[header_value]="a" |
| 1110 |
off=25 header_value complete |
| 1111 |
off=25 len=10 span[header_field]="Connection" |
| 1112 |
off=36 header_field complete |
| 1113 |
off=37 len=6 span[header_value]="close " |
| 1114 |
off=45 header_value complete |
| 1115 |
off=45 len=17 span[header_field]="Transfer-Encoding" |
| 1116 |
off=63 header_field complete |
| 1117 |
off=64 len=8 span[header_value]="chunked " |
| 1118 |
off=74 header_value complete |
| 1119 |
off=76 headers complete method=1 v=1/1 flags=20a content_length=0 |
| 1120 |
off=79 chunk header len=5 |
| 1121 |
off=79 len=5 span[body]="ABCDE" |
| 1122 |
off=84 chunk complete |
| 1123 |
off=87 chunk header len=0 |
| 1124 |
``` |
| 1125 |
|
| 1126 |
## Space after chunk header |
| 1127 |
|
| 1128 |
<!-- meta={"type": "request"} --> |
| 1129 |
```http |
| 1130 |
PUT /url HTTP/1.1 |
| 1131 |
Transfer-Encoding: chunked |
| 1132 |
|
| 1133 |
a \r\n0123456789 |
| 1134 |
0 |
| 1135 |
|
| 1136 |
|
| 1137 |
``` |
| 1138 |
|
| 1139 |
```log |
| 1140 |
off=0 message begin |
| 1141 |
off=0 len=3 span[method]="PUT" |
| 1142 |
off=3 method complete |
| 1143 |
off=4 len=4 span[url]="/url" |
| 1144 |
off=9 url complete |
| 1145 |
off=14 len=3 span[version]="1.1" |
| 1146 |
off=17 version complete |
| 1147 |
off=19 len=17 span[header_field]="Transfer-Encoding" |
| 1148 |
off=37 header_field complete |
| 1149 |
off=38 len=7 span[header_value]="chunked" |
| 1150 |
off=47 header_value complete |
| 1151 |
off=49 headers complete method=4 v=1/1 flags=208 content_length=0 |
| 1152 |
off=51 error code=12 reason="Invalid character in chunk size" |
| 1153 |
``` |
| 1154 |
|
| 1155 |
## Space after chunk header (lenient) |
| 1156 |
|
| 1157 |
<!-- meta={"type": "request-lenient-spaces-after-chunk-size"} --> |
| 1158 |
```http |
| 1159 |
PUT /url HTTP/1.1 |
| 1160 |
Transfer-Encoding: chunked |
| 1161 |
|
| 1162 |
a \r\n0123456789 |
| 1163 |
0 |
| 1164 |
|
| 1165 |
|
| 1166 |
``` |
| 1167 |
|
| 1168 |
```log |
| 1169 |
off=0 message begin |
| 1170 |
off=0 len=3 span[method]="PUT" |
| 1171 |
off=3 method complete |
| 1172 |
off=4 len=4 span[url]="/url" |
| 1173 |
off=9 url complete |
| 1174 |
off=14 len=3 span[version]="1.1" |
| 1175 |
off=17 version complete |
| 1176 |
off=19 len=17 span[header_field]="Transfer-Encoding" |
| 1177 |
off=37 header_field complete |
| 1178 |
off=38 len=7 span[header_value]="chunked" |
| 1179 |
off=47 header_value complete |
| 1180 |
off=49 headers complete method=4 v=1/1 flags=208 content_length=0 |
| 1181 |
off=53 chunk header len=10 |
| 1182 |
off=53 len=10 span[body]="0123456789" |
| 1183 |
off=65 chunk complete |
| 1184 |
off=68 chunk header len=0 |
| 1185 |
off=70 chunk complete |
| 1186 |
off=70 message complete |
| 1187 |
``` |