wip
This commit is contained in:
@ -59,7 +59,7 @@ export default class Resolver {
|
||||
throw new Error('invalid response');
|
||||
}
|
||||
|
||||
log(`resolved: ${JSON.stringify(object)}`);
|
||||
log(`resolved: ${JSON.stringify(object, null, 2)}`);
|
||||
|
||||
return object;
|
||||
}
|
||||
|
@ -1,9 +1,15 @@
|
||||
import { request } from 'https';
|
||||
import { sign } from 'http-signature';
|
||||
import { URL } from 'url';
|
||||
import * as debug from 'debug';
|
||||
|
||||
import config from '../config';
|
||||
|
||||
const log = debug('misskey:activitypub:deliver');
|
||||
|
||||
export default ({ account, username }, url, object) => new Promise((resolve, reject) => {
|
||||
log(`--> ${url}`);
|
||||
|
||||
const { protocol, hostname, port, pathname, search } = new URL(url);
|
||||
|
||||
const req = request({
|
||||
@ -14,6 +20,8 @@ export default ({ account, username }, url, object) => new Promise((resolve, rej
|
||||
path: pathname + search,
|
||||
}, res => {
|
||||
res.on('end', () => {
|
||||
log(`${url} --> ${res.statusCode}`);
|
||||
|
||||
if (res.statusCode >= 200 && res.statusCode < 300) {
|
||||
resolve();
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user