mirror of
https://github.com/gethomepage/homepage.git
synced 2025-12-07 09:35:54 -08:00
Fix: some error URLs aren't sanitized (#3385)
This commit is contained in:
@@ -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,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user