swift/test/unit
Tim Burke e8a80e874a Let users know entity size in 416 responses
If a user sends a Range header with no satisfiable ranges, we send back
a 416 Requested Range Not Satisfiable response. Previously however,
there would be no indication of the size of the object they were
requesting, so they wouldn't know how to craft a satisfiable range. We
*do* send a Content-Length, but it is (correctly) the length of the
error message.

The RFC [1] has an answer for this:

>  A server generating a 416 (Range Not Satisfiable) response to a
>  byte-range request SHOULD send a Content-Range header field with an
>  unsatisfied-range value, as in the following example:
>
>    Content-Range: bytes */1234
>
>  The complete-length in a 416 response indicates the current length of
>  the selected representation.

Now, we'll send a Content-Range header for all 416 responses, including
those coming from the object server as well as those generated on a
proxy because of the Range mangling required to support EC policies.

[1] RFC 7233, section 4.2, although similar language was used in RFC
2616, sections 10.4.17 and 14.16

Change-Id: I80c7390fc6f84a10a212b0641bb07a64dfccbd45
2016-11-30 10:52:08 -08:00
..
account Merge "More Test[Account|Container]Controller test updates" 2016-09-13 01:48:59 +00:00
cli Respect server type for --md5 check in swift-recon 2016-10-31 07:26:22 +00:00
common Let users know entity size in 416 responses 2016-11-30 10:52:08 -08:00
container Simplify container_updater test code 2016-10-12 13:14:39 +08:00
obj Fixed regression in consolidate_hashes 2016-11-25 11:40:48 +00:00
proxy Let users know entity size in 416 responses 2016-11-30 10:52:08 -08:00
test_locale monkeypatch thread for keystoneclient 2015-11-03 16:36:19 +01:00
__init__.py Fix ZeroDivisionError in reconstructor.stats_line 2016-11-07 18:19:20 -08:00
helpers.py Refactor tests and add tests 2016-06-15 16:36:25 +01:00