fix partial content 0 padding

This commit is contained in:
Jack Robison 2019-05-03 20:38:33 -04:00
parent bd6a609b30
commit f7412514b3
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2

View file

@ -317,7 +317,7 @@ class ManagedStream:
wrote = 0
async for blob_info, decrypted in self._aiter_read_stream(skip_blobs):
if (blob_info.blob_num == len(self.descriptor.blobs) - 2) or (len(decrypted) + wrote >= size):
decrypted += b'\x00' * (size - len(decrypted) - wrote)
decrypted += (b'\x00' * (size - len(decrypted) - wrote - (skip_blobs * 2097151)))
await response.write_eof(decrypted)
else:
await response.write(decrypted)