Fixed regression where OPTIONS resulted in 500 instead of 404
This commit is contained in:
parent
be578b8621
commit
cd7c37b136
@ -130,8 +130,7 @@ export async function dailyNoteCommand() {
|
|||||||
});
|
});
|
||||||
let dailyNoteTemplateText = "";
|
let dailyNoteTemplateText = "";
|
||||||
try {
|
try {
|
||||||
const text = await space.readPage(dailyNoteTemplate);
|
dailyNoteTemplateText = await space.readPage(dailyNoteTemplate);
|
||||||
dailyNoteTemplateText = text;
|
|
||||||
} catch {
|
} catch {
|
||||||
console.warn(`No daily note template found at ${dailyNoteTemplate}`);
|
console.warn(`No daily note template found at ${dailyNoteTemplate}`);
|
||||||
}
|
}
|
||||||
|
@ -439,10 +439,10 @@ function buildFsRouter(spacePrimitives: SpacePrimitives): Router {
|
|||||||
response.headers.set("X-Last-Modified", "" + meta.lastModified);
|
response.headers.set("X-Last-Modified", "" + meta.lastModified);
|
||||||
response.headers.set("X-Content-Length", "" + meta.size);
|
response.headers.set("X-Content-Length", "" + meta.size);
|
||||||
response.headers.set("X-Permission", meta.perm);
|
response.headers.set("X-Permission", meta.perm);
|
||||||
} catch (err) {
|
} catch {
|
||||||
response.status = 500;
|
response.status = 404;
|
||||||
response.body = "Options failed";
|
response.body = "File not found";
|
||||||
console.error("Options failed", err);
|
// console.error("Options failed", err);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.delete("\/(.+)", async ({ response, params }) => {
|
.delete("\/(.+)", async ({ response, params }) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user