Work on #587: revamped templates
This commit is contained in:
@@ -82,7 +82,7 @@ export async function cacheFileListing(uri: string): Promise<FileMeta[]> {
|
||||
const r = await nativeFetch(indexUrl, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
Accept: "application/json",
|
||||
"X-Sync-Mode": "true",
|
||||
"Cache-Control": "no-cache",
|
||||
},
|
||||
signal: fetchController.signal,
|
||||
@@ -119,7 +119,13 @@ export async function readFile(
|
||||
name: string,
|
||||
): Promise<{ data: Uint8Array; meta: FileMeta } | undefined> {
|
||||
const url = federatedPathToUrl(name);
|
||||
const r = await nativeFetch(url);
|
||||
console.log("Fetfching fedderated file", url);
|
||||
const r = await nativeFetch(url, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"X-Sync-Mode": "true",
|
||||
},
|
||||
});
|
||||
if (r.status === 503) {
|
||||
throw new Error("Offline");
|
||||
}
|
||||
@@ -195,6 +201,7 @@ export async function getFileMeta(name: string): Promise<FileMeta> {
|
||||
const r = await nativeFetch(url, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"X-Sync-Mode": "true",
|
||||
"X-Get-Meta": "true",
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user