mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-09 06:48:47 +00:00
Fix: some error URLs aren't sanitized (#3385)
This commit is contained in:
parent
daa51f9740
commit
ea63716b61
2 changed files with 8 additions and 2 deletions
|
@ -5,6 +5,7 @@ import { createUnzip, constants as zlibConstants } from "node:zlib";
|
|||
import { http, https } from "follow-redirects";
|
||||
|
||||
import { addCookieToJar, setCookieHeader } from "./cookie-jar";
|
||||
import { sanitizeErrorURL } from "./api-helpers";
|
||||
|
||||
import createLogger from "utils/logger";
|
||||
|
||||
|
@ -113,6 +114,11 @@ export async function httpProxy(url, params = {}) {
|
|||
constructedUrl.pathname,
|
||||
);
|
||||
if (err) logger.error(err);
|
||||
return [500, "application/json", { error: { message: err?.message ?? "Unknown error", url, rawError: err } }, null];
|
||||
return [
|
||||
500,
|
||||
"application/json",
|
||||
{ error: { message: err?.message ?? "Unknown error", url: sanitizeErrorURL(url), rawError: err } },
|
||||
null,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue