From 8ae9212cc5778675cada764fb2ce30bc7d912318 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Sat, 13 Apr 2024 20:01:17 +0300 Subject: [PATCH] #2075 Fix Draw Things auth --- src/endpoints/stable-diffusion.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/endpoints/stable-diffusion.js b/src/endpoints/stable-diffusion.js index e2168cd80..cc014f0e6 100644 --- a/src/endpoints/stable-diffusion.js +++ b/src/endpoints/stable-diffusion.js @@ -684,15 +684,17 @@ drawthings.post('/generate', jsonParser, async (request, response) => { const url = new URL(request.body.url); url.pathname = '/sdapi/v1/txt2img'; - const body = {...request.body}; + const body = { ...request.body }; + const auth = getBasicAuthHeader(request.body.auth); delete body.url; + delete body.auth; const result = await fetch(url, { method: 'POST', body: JSON.stringify(body), headers: { 'Content-Type': 'application/json', - 'Authorization': getBasicAuthHeader(request.body.auth), + 'Authorization': auth, }, timeout: 0, });