8thlight / cob_spec

A fitnesse suite for a web server
24 stars 33 forks source link

Add more comprehensive byte serving specs #25

Closed ukutaht closed 9 years ago

ukutaht commented 9 years ago

Currently the partial content test accounts only for one Range header format:

Range: bytes=$start-$end

RFC specifies how the server should respond if either the start or end is missing. I've added two specs to comply to the standard:

When the $start is missing the server should respond with the last $end number of bytes of the file.

Range: bytes=-10

This header is requesting the last 10 bytes of the file.

When the $end is missing, the server should respond with all bytes from $start to the end of the file, for example:

Range: bytes=4-

Means that we should serve all bytes of the file starting at index 4.