fix(pi-hole): wrong fetch used in factory (#2527)

This commit is contained in:
Meier Lukas
2025-03-07 18:14:50 +01:00
committed by GitHub
parent a572aae887
commit 9881577f47

View File

@@ -1,3 +1,4 @@
import { fetchWithTrustedCertificatesAsync } from "@homarr/certificates/server";
import { removeTrailingSlash } from "@homarr/common";
import type { IntegrationInput } from "../base/integration";
@@ -7,7 +8,7 @@ import { PiHoleIntegrationV6 } from "./v6/pi-hole-integration-v6";
export const createPiHoleIntegrationAsync = async (input: IntegrationInput) => {
const baseUrl = removeTrailingSlash(input.url);
const url = new URL(`${baseUrl}/api/info/version`);
const response = await fetch(url);
const response = await fetchWithTrustedCertificatesAsync(url);
/**
* In pi-hole 5 the api was at /admin/api.php, in pi-hole 6 it was moved to /api