Merge pull request #1 from Amarillys/Amarillys-patch-preview-header

Correct the Content-Disposition Header for preview image, in order to…
This commit is contained in:
Maikaze 2024-11-27 02:24:42 +08:00 committed by GitHub
commit 748df85f42
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -420,7 +420,7 @@ class PromptServer():
buffer.seek(0) buffer.seek(0)
return web.Response(body=buffer.read(), content_type=f'image/{image_format}', return web.Response(body=buffer.read(), content_type=f'image/{image_format}',
headers={"Content-Disposition": f"filename=\"{filename}\""}) headers={"Content-Disposition": f"filename=\"{filename.replace('png', image_format)}\""})
if 'channel' not in request.rel_url.query: if 'channel' not in request.rel_url.query:
channel = 'rgba' channel = 'rgba'