API refinements

This commit is contained in:
Zef Hemel
2023-08-15 20:15:27 +02:00
parent 5cf97272c1
commit 7cce83b240
4 changed files with 21 additions and 7 deletions
+7 -2
View File
@@ -182,8 +182,13 @@ export async function deleteFile(
export async function getFileMeta(name: string): Promise<FileMeta> {
const url = federatedPathToUrl(name);
console.log("Fetching federation file meta", url);
const r = await nativeFetch(url, { method: "HEAD" });
console.info("Fetching federation file meta", url);
const r = await nativeFetch(url, {
method: "GET",
headers: {
"X-Get-Meta": "true",
},
});
if (r.status === 503) {
throw new Error("Offline");
}