diff options
| author | MeiMei <30769358+mei23@users.noreply.github.com> | 2020-04-09 23:42:23 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-09 23:42:23 +0900 |
| commit | d3c0f3c251e8371d78d953f32f7311a38f4a1bdb (patch) | |
| tree | ef746ec79b4cc53ad15da2680b2e5d6280d39867 /src/remote/activitypub/request.ts | |
| parent | Create aiscript.ja-JP.md (diff) | |
| download | misskey-d3c0f3c251e8371d78d953f32f7311a38f4a1bdb.tar.gz misskey-d3c0f3c251e8371d78d953f32f7311a38f4a1bdb.tar.bz2 misskey-d3c0f3c251e8371d78d953f32f7311a38f4a1bdb.zip | |
Use node-fetch instead of request (#6228)
* requestをnode-fetchになど
* format
* fix error
* t
* Fix test
Diffstat (limited to 'src/remote/activitypub/request.ts')
| -rw-r--r-- | src/remote/activitypub/request.ts | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/remote/activitypub/request.ts b/src/remote/activitypub/request.ts index 0f87381a44..24540827b2 100644 --- a/src/remote/activitypub/request.ts +++ b/src/remote/activitypub/request.ts @@ -1,19 +1,12 @@ import * as https from 'https'; import { sign } from 'http-signature'; import * as crypto from 'crypto'; -import * as cache from 'lookup-dns-cache'; import config from '../../config'; import { ILocalUser } from '../../models/entities/user'; import { UserKeypairs } from '../../models'; import { ensure } from '../../prelude/ensure'; -import { HttpsProxyAgent } from 'https-proxy-agent'; - -const agent = config.proxy - ? new HttpsProxyAgent(config.proxy) - : new https.Agent({ - lookup: cache.lookup, - }); +import { httpsAgent } from '../../misc/fetch'; export default async (user: ILocalUser, url: string, object: any) => { const timeout = 10 * 1000; @@ -32,7 +25,7 @@ export default async (user: ILocalUser, url: string, object: any) => { await new Promise((resolve, reject) => { const req = https.request({ - agent, + agent: httpsAgent, protocol, hostname, port, |