When generating multi-part upload IDs remove / characters (#3164)

* / are not allowed in upload ids

* ran black
This commit is contained in:
Dean Kleissas 2020-07-22 12:01:31 -04:00 committed by GitHub
parent 448ff45174
commit 936c7c80f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -280,7 +280,9 @@ class FakeMultipart(BaseModel):
self.parts = {}
self.partlist = [] # ordered list of part ID's
rand_b64 = base64.b64encode(os.urandom(UPLOAD_ID_BYTES))
self.id = rand_b64.decode("utf-8").replace("=", "").replace("+", "")
self.id = (
rand_b64.decode("utf-8").replace("=", "").replace("+", "").replace("/", "")
)
def complete(self, body):
decode_hex = codecs.getdecoder("hex_codec")