mirror of
https://github.com/turbomaster95/coderrrrr.git
synced 2025-05-12 04:50:13 +00:00
22 lines
557 B
TypeScript
22 lines
557 B
TypeScript
import { AP } from "activitypub-core-types";
|
|
|
|
export async function fetchActorInformation(actorUrl: string): Promise<AP.Actor | null> {
|
|
try {
|
|
const response = await fetch(
|
|
actorUrl,
|
|
{
|
|
headers: {
|
|
"Content-type": 'application/activity+json',
|
|
"Accept": 'application/activity+json'
|
|
},
|
|
signal: AbortSignal.timeout(5000) // kill after 5 seconds
|
|
}
|
|
);
|
|
|
|
return await response.json();
|
|
} catch (error) {
|
|
console.log("Unable to fetch action information", actorUrl);
|
|
}
|
|
return null;
|
|
}
|