mirror of
https://github.com/zadam/trilium.git
synced 2026-03-22 00:03:41 +01:00
fix(share): return 503 when app is still initializing (#5677)
This commit is contained in:
parent
d1159d3af9
commit
1990a990c3
@ -10,7 +10,15 @@ import type SNote from "./shaca/entities/snote.js";
|
||||
import type SAttachment from "./shaca/entities/sattachment.js";
|
||||
import { getDefaultTemplatePath, renderNoteContent } from "./content_renderer.js";
|
||||
import utils from "../services/utils.js";
|
||||
import { isShareDbReady } from "./sql.js";
|
||||
|
||||
function assertShareDbReady(res: Response): boolean {
|
||||
if (!isShareDbReady()) {
|
||||
res.status(503).send("The application is still initializing. Please try again in a moment.");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
function addNoIndexHeader(note: SNote, res: Response) {
|
||||
if (note.isLabelTruthy("shareDisallowRobotIndexing")) {
|
||||
res.setHeader("X-Robots-Tag", "noindex");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user