From 6e34e77372bd74c85ebf5a6b4214c818231dbe8b Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 8 Apr 2018 06:55:26 +0900 Subject: Implement announce And bug fixes --- src/remote/activitypub/resolver.ts | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/remote/activitypub/resolver.ts') diff --git a/src/remote/activitypub/resolver.ts b/src/remote/activitypub/resolver.ts index 4a97e2ef66..1466139c48 100644 --- a/src/remote/activitypub/resolver.ts +++ b/src/remote/activitypub/resolver.ts @@ -1,6 +1,7 @@ import * as request from 'request-promise-native'; import * as debug from 'debug'; import { IObject } from './type'; +//import config from '../../config'; const log = debug('misskey:activitypub:resolver'); @@ -47,6 +48,11 @@ export default class Resolver { this.history.add(value); + //#region resolve local objects + // TODO + //if (value.startsWith(`${config.url}/@`)) { + //#endregion + const object = await request({ url: value, headers: { @@ -60,6 +66,7 @@ export default class Resolver { !object['@context'].includes('https://www.w3.org/ns/activitystreams') : object['@context'] !== 'https://www.w3.org/ns/activitystreams' )) { + log(`invalid response: ${JSON.stringify(object, null, 2)}`); throw new Error('invalid response'); } -- cgit v1.2.3-freya