Feature: allow disable ipv6 in proxy, refactor cacheFetch to use proxy (#5011)

This commit is contained in:
shamoon 2025-03-16 20:09:34 -07:00 committed by GitHub
parent 934ad3a6f1
commit b4dc53c7c0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 61 additions and 65 deletions

View file

@ -1,7 +1,7 @@
import { searchProviders } from "components/widgets/search/search";
import { getSettings } from "utils/config/config";
import cachedFetch from "utils/proxy/cached-fetch";
import { cachedRequest } from "utils/proxy/http";
import { widgetsFromConfig } from "utils/config/widget-helpers";
export default async function handler(req, res) {
@ -29,5 +29,5 @@ export default async function handler(req, res) {
return res.json([query, []]); // Responde with the same array format but with no suggestions.
}
return res.send(await cachedFetch(`${provider.suggestionUrl}${encodeURIComponent(query)}`, 5, "Mozilla/5.0"));
return res.send(await cachedRequest(`${provider.suggestionUrl}${encodeURIComponent(query)}`, 5, "Mozilla/5.0"));
}