playing with content-length

These tests look at the behavior if the content-length mismatches the content, e.g. content is short or longer then specified length or contradicting content-lenth headers are given.

VALID: single or no content-length

single content-length with connection close
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

no content-length with connection close
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

single content-length, content followed by junk, then connection close
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

correct content-length twice, content followed by junk, then connection close
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

lots of 0 before clen
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

lots of 0 before clen, body content+junk
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

INVALID: content-length does not match content

content-length double real content, close after real content
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

content-length half real content, close after real content
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

INVALID: multiple conflicting content-length

content-length half and full
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

content-length full and half
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

content-length double and full, content followed by junk and close
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

content-length full and double, content followed by junk and close
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

content-length full (folded) and double
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

content-length half and full, invalid Transfer-Encoding
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

content-length full and half, invalid Transfer-Encoding
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

content-length double and full, invalid Transfer-Encoding
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

content-length full and double, invalid Transfer-Encoding
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

content-length full (folded) and double, invalid Transfer-Encoding
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

INVALID: multiple content-length, but one empty or invalid

content-length full and empty
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

content-length full and empty, content followed by junk and close
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

content-length empty and full
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

content-length empty and full, content followed by junk and close
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

content-length full and invalid
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

content-length full and invalid, content followed by junk and close
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

content-length invalid and full
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

content-length invalid and full, content followed by junk and close
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

INVALID: content-length header containing two numbers

content-length half but full after line folding, close after real content
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

content-length half and full on same line, close after real content
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

content-length half and full on same line, but full as MIME comment, close after real content
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

content-length full but half after line folding, close after real content
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

content-length full and half on same line, close after real content
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

content-length full and half on same line, but full as MIME comment, close after real content
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

content-length full but double after line folding, close after real content+junk
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

content-length full and double on same line, but double as MIME comment, close after real content+junk
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

content-length double but full after line folding, close after real content+junk
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

content-length double and full on same line, but double as MIME comment, close after real content+junk
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

INVALID: invalid characters around content-length value

"Content-length: ;len", body content+junk
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

"Content-length: len;", body content+junk
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

"Content-length: ,len", body content+junk
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

"Content-length: len,", body content+junk
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

"Content-length: len,len", body content+junk
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

'Content-length: "len"', body content+junk
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

"Content-length: lenA", body content+junk
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

"Content-length: Alen", body content+junk
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

"Content-length: len A", body content+junk
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

"Content-length: A len", body content+junk
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

"Content-length: \240len", body content+junk
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

"Content-length: len\240", body content+junk
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

"Content-length: len.0", body content+junk
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

"Content-length: len.9", body content+junk
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

Content-length value with \0 inside, body content
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

Content-length value with \0 inside, body content+junk
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

INVALID: bad content-length value (hex, overflow, huge...)

"Content-length: 0xhexlen", body content
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

"Content-length: 0xhexlen", body content+junk
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

overflowing uint32, body content
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

overflowing uint32, body content+junk
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

huge >64bit fake clen
IMAGE
SCRIPT
 load EICAR  load eicar.zip 

big 1GB fake clen
IMAGE
SCRIPT
 load EICAR  load eicar.zip