8thlight / cob_spec

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

Incorrect assertion for PartialContent test #72

Closed bgerstle closed 6 years ago

bgerstle commented 6 years ago

According to RFC 7233 section 2.1: "if the [suffix length] value is greater than or equal to the length...the byte range is interpreted as the remainder of the representation." In other words, if I request the range 1-1000 for a file that's 5 bytes long, I should get a valid response with Content-Range: 1-4.

Instead, cob_spec requests the range 75-80 for a file that's 77 bytes long, and expects to receive a response with the 416 status code and a Content-Range header with the value */77.

bgerstle commented 6 years ago

Example failure: image

bgerstle commented 6 years ago

Here are some examples of invalid ranges that could be used for the test:

trptcolin commented 6 years ago

👍 makes sense to me. Any objections @jdesrosiers or others?

jdesrosiers commented 6 years ago

@bgerstle, Good catch! Can you create a PR for this? We should keep and fix the test for this scenario, then add others for the 416 cases.

Ideally it would be great if we could break the PartialContent test into multiple tests and separate them into their own suite.