From 41289a23089577fbfe82b6d5ea7b95da6eea9a50 Mon Sep 17 00:00:00 2001 From: Tobias Bocanegra Date: Wed, 11 Dec 2024 08:05:44 +0100 Subject: [PATCH 1/2] fix: include proxy url in 401 responses --- src/server/utils.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/server/utils.js b/src/server/utils.js index 8b13d3773..6fe423d66 100644 --- a/src/server/utils.js +++ b/src/server/utils.js @@ -348,6 +348,20 @@ window.LiveReloadOptions = { .send(textBody); return; } + if (ret.status === 401) { + let textBody = await ret.text(); + textBody = ` + +

${textBody}

+ +`; + respHeaders['content-type'] = 'text/html'; + res + .set(respHeaders) + .status(ret.status) + .send(textBody); + return; + } if (ctx.log.level === 'silly') { ctx.log.trace(`[${id}] <<<--------------------------`); From f30dc0becbf808448e126ae7dac3414e3901ef6f Mon Sep 17 00:00:00 2001 From: Tobias Bocanegra Date: Wed, 11 Dec 2024 08:53:18 +0100 Subject: [PATCH 2/2] chore: adjust body --- src/server/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/utils.js b/src/server/utils.js index 6fe423d66..157a6eb86 100644 --- a/src/server/utils.js +++ b/src/server/utils.js @@ -352,7 +352,7 @@ window.LiveReloadOptions = { let textBody = await ret.text(); textBody = ` -

${textBody}

+
${textBody}
`; respHeaders['content-type'] = 'text/html';