From 8fe0e5391e9b5550fcd1f17e5ef857a45fb70572 Mon Sep 17 00:00:00 2001 From: Maikaze Date: Wed, 27 Nov 2024 02:23:22 +0800 Subject: [PATCH] Correct the Content-Disposition Header for preview image, in order to download as corrent filename To avoid download a webp preview image with a '.png' filename --- server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server.py b/server.py index e663095b..b811e94a 100644 --- a/server.py +++ b/server.py @@ -420,7 +420,7 @@ class PromptServer(): buffer.seek(0) 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: channel = 'rgba'