diff options
| author | MeiMei <30769358+mei23@users.noreply.github.com> | 2020-10-18 01:46:40 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-18 01:46:40 +0900 |
| commit | 85a0f696bcea779b02749dae596fff94a1df2467 (patch) | |
| tree | 747ee51f96c7ada22a835dfc7faee0b13cdfd0e4 /src/misc/fetch.ts | |
| parent | Fix lint (#6732) (diff) | |
| download | sharkey-85a0f696bcea779b02749dae596fff94a1df2467.tar.gz sharkey-85a0f696bcea779b02749dae596fff94a1df2467.tar.bz2 sharkey-85a0f696bcea779b02749dae596fff94a1df2467.zip | |
ActivityPubでリモートのオブジェクトをGETするときのリクエストをHTTP Signatureで署名するオプション (#6731)
* Sign ActivityPub GET
* Fix v12, v12.48.0 UI bug
Diffstat (limited to 'src/misc/fetch.ts')
| -rw-r--r-- | src/misc/fetch.ts | 5 |
1 files changed, 3 insertions, 2 deletions
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; /** |