From b44d602e36b62fd150b30bde76f198ff4d035953 Mon Sep 17 00:00:00 2001 From: Sofia Papagiannaki Date: Fri, 1 Jul 2011 17:32:15 +0300 Subject: [PATCH] If-Range header support in object GET Refs #567 --- tools/store | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/store b/tools/store index 6ad96e3..316ae52 100755 --- a/tools/store +++ b/tools/store @@ -255,6 +255,8 @@ class GetObject(Command): default=False, help='show detailed output') parser.add_option('--range', action='store', dest='range', default=None, help='show range of data') + parser.add_option('--if-range', action='store', dest='if-range', + default=None, help='show range of data') parser.add_option('--if-match', action='store', dest='if-match', default=None, help='show output if ETags match') parser.add_option('--if-none-match', action='store', @@ -281,6 +283,8 @@ class GetObject(Command): headers = {} if self.range: headers['RANGE'] = 'bytes=%s' %self.range + if getattr(self, 'if-range'): + headers['IF_RANGE'] = 'If-Range:%s' % getattr(self, 'if-range') attrs = ['if-match', 'if-none-match', 'if-modified-since', 'if-unmodified-since'] attrs = [a for a in attrs if getattr(self, a)] -- 1.7.10.4