#2075 Fix Draw Things auth
This commit is contained in:
parent
de8339f77b
commit
3a4405016c
|
@ -685,14 +685,16 @@ drawthings.post('/generate', jsonParser, async (request, response) => {
|
||||||
url.pathname = '/sdapi/v1/txt2img';
|
url.pathname = '/sdapi/v1/txt2img';
|
||||||
|
|
||||||
const body = { ...request.body };
|
const body = { ...request.body };
|
||||||
|
const auth = getBasicAuthHeader(request.body.auth);
|
||||||
delete body.url;
|
delete body.url;
|
||||||
|
delete body.auth;
|
||||||
|
|
||||||
const result = await fetch(url, {
|
const result = await fetch(url, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: JSON.stringify(body),
|
body: JSON.stringify(body),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Authorization': getBasicAuthHeader(request.body.auth),
|
'Authorization': auth,
|
||||||
},
|
},
|
||||||
timeout: 0,
|
timeout: 0,
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue