Skip to content

Commit

Permalink
fix mime type
Browse files Browse the repository at this point in the history
  • Loading branch information
diwu-sf committed Feb 14, 2025
1 parent 275f1d2 commit 05a2aaf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ def copy_from(self, path: str) -> Path:
stream=True,
timeout=30,
) as response:
with tempfile.NamedTemporaryFile(delete=False) as temp_file:
with tempfile.NamedTemporaryFile(
suffix='.zip', delete=False
) as temp_file:
shutil.copyfileobj(response.raw, temp_file, length=16 * 1024)
return Path(temp_file.name)
except requests.Timeout:
Expand Down
2 changes: 1 addition & 1 deletion openhands/server/routes/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ def zip_current_workspace(request: Request, conversation_id: str):
return FileResponse(
path=zip_file_path,
filename='workspace.zip',
media_type='application/x-zip-compressed',
media_type='application/zip',
background=BackgroundTask(lambda: os.unlink(zip_file_path)),
)
except Exception as e:
Expand Down

0 comments on commit 05a2aaf

Please sign in to comment.