'Remove the first byterange from our Range header.
This is used after a byterange has been completely sent to the
client; this way, should we need to resume the download from another
object server, we do not re-fetch byteranges that the client already
has.
If we have no Range header, this is a no-op.'

def pop_range(self):

    if ('Range' in self.backend_headers):
        try:
            req_range = Range(self.backend_headers['Range'])
        except ValueError:
            self.backend_headers.pop('Range')
            return
        (begin, end) = req_range.ranges.pop(0)
        if (len(req_range.ranges) > 0):
            self.backend_headers['Range'] = str(req_range)
        else:
            self.backend_headers.pop('Range')
