No More Collab. Fixes #449

* Fully removes real-time collaboration
* URL scheme rewrite
This commit is contained in:
Zef Hemel
2023-07-06 16:47:50 +02:00
committed by GitHub
parent 021bf7e9a4
commit fb75ea1a65
45 changed files with 380 additions and 1356 deletions
+1 -4
View File
@@ -5,9 +5,6 @@ import { readSetting } from "$sb/lib/settings_page.ts";
function resolveFederated(pageName: string): string {
// URL without the prefix "!""
let url = pageName.substring(1);
const pieces = url.split("/");
pieces.splice(1, 0, ".fs");
url = pieces.join("/");
if (!url.startsWith("127.0.0.1") && !url.startsWith("localhost")) {
url = `https://${url}`;
} else {
@@ -153,7 +150,7 @@ export async function deleteFile(
export async function getFileMeta(name: string): Promise<FileMeta> {
const url = resolveFederated(name);
console.log("Fetching federation file meta", url);
const r = await nativeFetch(url, { method: "OPTIONS" });
const r = await nativeFetch(url, { method: "HEAD" });
const fileMeta = await responseToFileMeta(r, name);
if (!r.ok) {
throw new Error("Not found");