From 85a0f696bcea779b02749dae596fff94a1df2467 Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Sun, 18 Oct 2020 01:46:40 +0900 Subject: ActivityPubでリモートのオブジェクトをGETするときのリクエストをHTTP Signatureで署名するオプション (#6731) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Sign ActivityPub GET * Fix v12, v12.48.0 UI bug --- src/misc/fetch.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/misc') diff --git a/src/misc/fetch.ts b/src/misc/fetch.ts index 7be0e53fd4..90d89a4392 100644 --- a/src/misc/fetch.ts +++ b/src/misc/fetch.ts @@ -5,6 +5,7 @@ import fetch, { HeadersInit } from 'node-fetch'; import { HttpProxyAgent } from 'http-proxy-agent'; import { HttpsProxyAgent } from 'https-proxy-agent'; import config from '../config'; +import { URL } from 'url'; export async function getJson(url: string, accept = 'application/json, */*', timeout = 10000, headers?: HeadersInit) { const res = await fetch(url, { @@ -69,14 +70,14 @@ const _https = new https.Agent({ * Get http proxy or non-proxy agent */ export const httpAgent = config.proxy - ? new HttpProxyAgent(config.proxy) + ? new HttpProxyAgent(config.proxy) as unknown as http.Agent : _http; /** * Get https proxy or non-proxy agent */ export const httpsAgent = config.proxy - ? new HttpsProxyAgent(config.proxy) + ? new HttpsProxyAgent(config.proxy) as unknown as https.Agent : _https; /** -- cgit v1.2.3-freya