From 513e3959aacfbd26bbd70db48843b22e7b0bdd5c Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Sun, 16 Mar 2025 14:37:39 -0700 Subject: [PATCH] Use proxy for cached fetch --- src/utils/proxy/cached-fetch.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/proxy/cached-fetch.js b/src/utils/proxy/cached-fetch.js index ae3c46108..6836888aa 100644 --- a/src/utils/proxy/cached-fetch.js +++ b/src/utils/proxy/cached-fetch.js @@ -1,4 +1,5 @@ import cache from "memory-cache"; +import { httpProxy } from "utils/proxy/http"; const defaultDuration = 5; @@ -12,14 +13,13 @@ export default async function cachedFetch(url, duration, ua) { return cached; } - // wrapping text in JSON.parse to handle utf-8 issues const options = {}; if (ua) { options.headers = { "User-Agent": ua, }; } - const data = await fetch(url, options).then((res) => res.json()); + const [, , data] = await httpProxy(url, options); cache.put(url, data, duration * 1000 * 60); return data; }