From b82d0264dce60a572df85b36d7bc35f971c9843c Mon Sep 17 00:00:00 2001 From: MurphyMarkW Date: Tue, 30 Jun 2015 02:04:30 -0500 Subject: [PATCH] Fixes suffix range requests to truncate ranges. --- moto/s3/responses.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/moto/s3/responses.py b/moto/s3/responses.py index b6113fafe..adaefc230 100644 --- a/moto/s3/responses.py +++ b/moto/s3/responses.py @@ -254,7 +254,7 @@ class ResponseObject(_TemplateEnvironmentMixin): if begin is not None: # byte range end = last if end is None else min(end, last) elif end is not None: # suffix byte range - begin = length - end + begin = length - min(end, length) end = last else: return 400, headers, ""