Added 'created' attribute to files and pages

This commit is contained in:
Zef Hemel
2023-11-03 09:38:04 +01:00
parent 3f1aa45b5d
commit 509683c537
16 changed files with 39 additions and 2 deletions
+2
View File
@@ -108,6 +108,7 @@ export class HttpSpacePrimitives implements SpacePrimitives {
"Content-Type": "application/octet-stream",
};
if (meta) {
headers["X-Created"] = "" + meta.created;
headers["X-Last-Modified"] = "" + meta.lastModified;
headers["X-Perm"] = "" + meta.perm;
}
@@ -165,6 +166,7 @@ export class HttpSpacePrimitives implements SpacePrimitives {
? +res.headers.get("X-Content-Length")!
: +res.headers.get("Content-Length")!,
contentType: res.headers.get("Content-type")!,
created: +(res.headers.get("X-Created") || "0"),
lastModified: +(res.headers.get("X-Last-Modified") || "0"),
perm: (res.headers.get("X-Permission") as "rw" | "ro") || "ro",
};