mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 09:06:15 +01:00
fix: handle webfinger responses with subject missing scheme
This commit is contained in:
@@ -131,9 +131,12 @@ Helpers.query = async (id) => {
|
|||||||
({ href: actorUri } = actorUri);
|
({ href: actorUri } = actorUri);
|
||||||
}
|
}
|
||||||
|
|
||||||
const { subject, publicKey } = body;
|
let { subject, publicKey } = body;
|
||||||
|
// Fix missing scheme
|
||||||
|
if (!subject.startsWith('acct:') && !subject.startsWith('did:')) {
|
||||||
|
subject = `acct:${subject}`;
|
||||||
|
}
|
||||||
const payload = { subject, username, hostname, actorUri, publicKey };
|
const payload = { subject, username, hostname, actorUri, publicKey };
|
||||||
|
|
||||||
const claimedId = new URL(subject).pathname;
|
const claimedId = new URL(subject).pathname;
|
||||||
webfingerCache.set(claimedId, payload);
|
webfingerCache.set(claimedId, payload);
|
||||||
if (claimedId !== id) {
|
if (claimedId !== id) {
|
||||||
|
|||||||
Reference in New Issue
Block a user