From 2cdab4cab9c6de844da802c2bc546cf2e62a6288 Mon Sep 17 00:00:00 2001 From: MurphyMarkW Date: Mon, 29 Jun 2015 20:25:22 -0500 Subject: [PATCH] Fixes last-byte-pos interpretation. --- 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 3fe391cd3..f9e8f9e6d 100644 --- a/moto/s3/responses.py +++ b/moto/s3/responses.py @@ -252,7 +252,7 @@ class ResponseObject(_TemplateEnvironmentMixin): toint = lambda i: int(i) if i else None begin, end = map(toint, rspec.split('-')) if begin is not None: # byte range - end = last if end is None else end + end = last if end is None else min(end, last) elif end is not None: # suffix byte range begin = length - end end = last