diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-11-21 13:43:29 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-11-27 19:40:52 +0100 |
commit | 0f91ae62df8a37194fea84ce1efa9e733d9c1fd8 (patch) | |
tree | 1cb0fccadebb629d02632dc8e21fae7ba521c464 /server/helpers/webfinger.ts | |
parent | 81de19482b89342c3dbc098a9f512ef7f1056e45 (diff) | |
download | PeerTube-0f91ae62df8a37194fea84ce1efa9e733d9c1fd8.tar.gz PeerTube-0f91ae62df8a37194fea84ce1efa9e733d9c1fd8.tar.zst PeerTube-0f91ae62df8a37194fea84ce1efa9e733d9c1fd8.zip |
Add follow tests
Diffstat (limited to 'server/helpers/webfinger.ts')
-rw-r--r-- | server/helpers/webfinger.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/server/helpers/webfinger.ts b/server/helpers/webfinger.ts index b7408c845..a5b4785fe 100644 --- a/server/helpers/webfinger.ts +++ b/server/helpers/webfinger.ts | |||
@@ -1,9 +1,9 @@ | |||
1 | import * as WebFinger from 'webfinger.js' | 1 | import * as WebFinger from 'webfinger.js' |
2 | import { WebFingerData } from '../../shared' | 2 | import { WebFingerData } from '../../shared' |
3 | import { fetchRemoteAccount } from '../lib/activitypub/account' | ||
3 | 4 | ||
4 | import { isTestInstance } from './core-utils' | 5 | import { isTestInstance } from './core-utils' |
5 | import { isActivityPubUrlValid } from './custom-validators' | 6 | import { isActivityPubUrlValid } from './custom-validators' |
6 | import { fetchRemoteAccountAndCreateServer } from '../lib/activitypub/account' | ||
7 | 7 | ||
8 | const webfinger = new WebFinger({ | 8 | const webfinger = new WebFinger({ |
9 | webfist_fallback: false, | 9 | webfist_fallback: false, |
@@ -22,10 +22,10 @@ async function getAccountFromWebfinger (nameWithHost: string) { | |||
22 | throw new Error('Cannot find self link or href is not a valid URL.') | 22 | throw new Error('Cannot find self link or href is not a valid URL.') |
23 | } | 23 | } |
24 | 24 | ||
25 | const res = await fetchRemoteAccountAndCreateServer(selfLink.href) | 25 | const account = await fetchRemoteAccount(selfLink.href) |
26 | if (res === undefined) throw new Error('Cannot fetch and create server of remote account ' + selfLink.href) | 26 | if (account === undefined) throw new Error('Cannot fetch remote account ' + selfLink.href) |
27 | 27 | ||
28 | return res.account | 28 | return account |
29 | } | 29 | } |
30 | 30 | ||
31 | // --------------------------------------------------------------------------- | 31 | // --------------------------------------------------------------------------- |