summaryrefslogtreecommitdiff
path: root/src/misc/fetch.ts
diff options
context:
space:
mode:
authorMeiMei <30769358+mei23@users.noreply.github.com>2021-05-19 16:11:47 +0900
committerGitHub <noreply@github.com>2021-05-19 16:11:47 +0900
commit961b3177d5a8ab52de6b13cb6986fce7d0b78a98 (patch)
treea397955dc6babd22919d9cb1f3d148e0145cf6bd /src/misc/fetch.ts
parentUpdate preloaded JSON-LD (#7521) (diff)
downloadsharkey-961b3177d5a8ab52de6b13cb6986fce7d0b78a98.tar.gz
sharkey-961b3177d5a8ab52de6b13cb6986fce7d0b78a98.tar.bz2
sharkey-961b3177d5a8ab52de6b13cb6986fce7d0b78a98.zip
Fix Agent type, httpでもDNSキャッシュ (#7520)
Diffstat (limited to 'src/misc/fetch.ts')
-rw-r--r--src/misc/fetch.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/misc/fetch.ts b/src/misc/fetch.ts
index ee671f59be..37f8203543 100644
--- a/src/misc/fetch.ts
+++ b/src/misc/fetch.ts
@@ -55,7 +55,8 @@ export async function getHtml(url: string, accept = 'text/html, */*', timeout =
const _http = new http.Agent({
keepAlive: true,
keepAliveMsecs: 30 * 1000,
-});
+ lookup: cache.lookup,
+} as http.AgentOptions);
/**
* Get https non-proxy agent
@@ -70,14 +71,14 @@ const _https = new https.Agent({
* Get http proxy or non-proxy agent
*/
export const httpAgent = config.proxy
- ? new HttpProxyAgent(config.proxy) as unknown as http.Agent
+ ? new HttpProxyAgent(config.proxy)
: _http;
/**
* Get https proxy or non-proxy agent
*/
export const httpsAgent = config.proxy
- ? new HttpsProxyAgent(config.proxy) as unknown as https.Agent
+ ? new HttpsProxyAgent(config.proxy)
: _https;
/**