mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-02-09 21:12:36 +08:00
Merge branch 'comfyanonymous:master' into master
This commit is contained in:
commit
b858113f19
@ -1,4 +1,4 @@
|
|||||||
comfyui-frontend-package==1.21.5
|
comfyui-frontend-package==1.21.6
|
||||||
comfyui-workflow-templates==0.1.25
|
comfyui-workflow-templates==0.1.25
|
||||||
comfyui-embedded-docs==0.2.0
|
comfyui-embedded-docs==0.2.0
|
||||||
torch
|
torch
|
||||||
|
|||||||
@ -390,7 +390,7 @@ class PromptServer():
|
|||||||
async def view_image(request):
|
async def view_image(request):
|
||||||
if "filename" in request.rel_url.query:
|
if "filename" in request.rel_url.query:
|
||||||
filename = request.rel_url.query["filename"]
|
filename = request.rel_url.query["filename"]
|
||||||
filename,output_dir = folder_paths.annotated_filepath(filename)
|
filename, output_dir = folder_paths.annotated_filepath(filename)
|
||||||
|
|
||||||
if not filename:
|
if not filename:
|
||||||
return web.Response(status=400)
|
return web.Response(status=400)
|
||||||
@ -476,9 +476,8 @@ class PromptServer():
|
|||||||
# Get content type from mimetype, defaulting to 'application/octet-stream'
|
# Get content type from mimetype, defaulting to 'application/octet-stream'
|
||||||
content_type = mimetypes.guess_type(filename)[0] or 'application/octet-stream'
|
content_type = mimetypes.guess_type(filename)[0] or 'application/octet-stream'
|
||||||
|
|
||||||
# For security, force certain extensions to download instead of display
|
# For security, force certain mimetypes to download instead of display
|
||||||
file_extension = os.path.splitext(filename)[1].lower()
|
if content_type in {'text/html', 'text/html-sandboxed', 'application/xhtml+xml', 'text/javascript', 'text/css'}:
|
||||||
if file_extension in {'.html', '.htm', '.js', '.css'}:
|
|
||||||
content_type = 'application/octet-stream' # Forces download
|
content_type = 'application/octet-stream' # Forces download
|
||||||
|
|
||||||
return web.FileResponse(
|
return web.FileResponse(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user