Fix headers in Federation and User entities

This commit is contained in:
Jesse Wierzbinski 2024-04-09 20:37:38 -10:00
parent 34499bfecb
commit 8bcf46641c
No known key found for this signature in database
3 changed files with 3 additions and 2 deletions

View file

@ -50,7 +50,7 @@ export const objectToInboxRequest = async (
headers: { headers: {
"Content-Type": "application/json", "Content-Type": "application/json",
Date: date.toISOString(), Date: date.toISOString(),
Origin: config.http.base_url, Origin: new URL(config.http.base_url).host,
Signature: `keyId="${author.uri}",algorithm="ed25519",headers="(request-target) host date digest",signature="${signatureBase64}"`, Signature: `keyId="${author.uri}",algorithm="ed25519",headers="(request-target) host date digest",signature="${signatureBase64}"`,
}, },
body: JSON.stringify(object), body: JSON.stringify(object),

View file

@ -25,6 +25,8 @@ export const addInstanceIfNotExists = async (
if (found) return found; if (found) return found;
console.log(`Fetching instance metadata for ${origin}`);
// Fetch the instance configuration // Fetch the instance configuration
const metadata = (await fetch(new URL("/.well-known/lysand", origin)).then( const metadata = (await fetch(new URL("/.well-known/lysand", origin)).then(
(res) => res.json(), (res) => res.json(),

View file

@ -137,7 +137,6 @@ export const resolveUser = async (uri: string) => {
const response = await fetch(uri, { const response = await fetch(uri, {
method: "GET", method: "GET",
headers: { headers: {
"Content-Type": "application/json",
Accept: "application/json", Accept: "application/json",
}, },
}); });