fix - audio_transcriptions security fix

This commit is contained in:
Ishaan Jaff 2024-04-20 11:58:15 -07:00
parent e52e4cc1a9
commit 5d39865362

View file

@ -4166,6 +4166,9 @@ async def audio_transcriptions(
file.filename is not None
) # make sure filename passed in (needed for type)
# rename the file to a random hash file name -> we eventuall remove the file and don't want to remove any local files
file.filename = f"tmp-request" + str(uuid.uuid4())
with open(file.filename, "wb+") as f:
f.write(await file.read())
try: