path: tests/fixtures/llhttp/request/content-length-reset-when-no-body-is-received.yml
name: Content-Length Reset When No Body Is Received
checked: true
source:
  path: test/request/content-length.md
  line: 444
meta:
  skipBody: true
  type: request
input:
- PUT /url HTTP/1.1
- 'Content-Length: 123'
- ''
- POST /url HTTP/1.1
- 'Content-Length: 456'
- ''
- ''
llhttp:
- off=0 message begin
- off=0 len=3 span[method]="PUT"
- off=3 method complete
- off=4 len=4 span[url]="/url"
- off=9 url complete
- off=9 len=4 span[protocol]="HTTP"
- off=13 protocol complete
- off=14 len=3 span[version]="1.1"
- off=17 version complete
- off=19 len=14 span[header_field]="Content-Length"
- off=34 header_field complete
- off=35 len=3 span[header_value]="123"
- off=40 header_value complete
- off=42 headers complete method=4 v=1/1 flags=20 content_length=123
- off=42 skip body
- off=42 message complete
- off=42 reset
- off=42 message begin
- off=42 len=4 span[method]="POST"
- off=46 method complete
- off=47 len=4 span[url]="/url"
- off=52 url complete
- off=52 len=4 span[protocol]="HTTP"
- off=56 protocol complete
- off=57 len=3 span[version]="1.1"
- off=60 version complete
- off=62 len=14 span[header_field]="Content-Length"
- off=77 header_field complete
- off=78 len=3 span[header_value]="456"
- off=83 header_value complete
- off=85 headers complete method=3 v=1/1 flags=20 content_length=456
- off=85 skip body
- off=85 message complete
output:
- offset: 0
  type: request
  payload: null
- offset: 0
  type: begin
  payload: null
- offset: 0
  type: method
  payload: PUT
- offset: 4
  type: url
  payload: /url
- offset: 9
  type: protocol
  payload: HTTP
- offset: 14
  type: version
  payload: '1.1'
- offset: 19
  type: header_name
  payload: Content-Length
- offset: 35
  type: header_value
  payload: '123'
- offset: 42
  type: headers
  payload:
    method: PUT
    status: null
    url: /url
    protocol: HTTP
    version: '1.1'
    body: 123
- offset: 42
  type: complete
  payload: null
- offset: 42
  type: request
  payload: null
- offset: 42
  type: begin
  payload: null
- offset: 42
  type: method
  payload: POST
- offset: 47
  type: url
  payload: /url
- offset: 52
  type: protocol
  payload: HTTP
- offset: 57
  type: version
  payload: '1.1'
- offset: 62
  type: header_name
  payload: Content-Length
- offset: 78
  type: header_value
  payload: '456'
- offset: 85
  type: headers
  payload:
    method: POST
    status: null
    url: /url
    protocol: HTTP
    version: '1.1'
    body: 456
- offset: 85
  type: complete
  payload: null
