revert: "feat(ping): ignore certificate error and show request durati… (#3680)

Co-authored-by: Meier Lukas <meierschlumpf@gmail.com>
This commit is contained in:
Manuel
2025-08-01 12:08:34 +02:00
committed by GitHub
parent c92bbd2da0
commit 8eb44c9f23
18 changed files with 285 additions and 136 deletions

View File

@@ -6,6 +6,7 @@ import { Agent as HttpsAgent } from "node:https";
import path from "node:path";
import { checkServerIdentity, rootCertificates } from "node:tls";
import axios from "axios";
import type { RequestInfo, RequestInit, Response } from "undici";
import { fetch } from "undici";
import { env } from "@homarr/common/env";
@@ -131,8 +132,8 @@ export const createAxiosCertificateInstanceAsync = async (
});
};
export const fetchWithTrustedCertificatesAsync: typeof fetch = async (url, options) => {
const agent = await createCertificateAgentAsync();
export const fetchWithTrustedCertificatesAsync = async (url: RequestInfo, options?: RequestInit): Promise<Response> => {
const agent = await createCertificateAgentAsync(undefined);
return fetch(url, {
...options,
dispatcher: agent,