fix: Do not prefetch JS bundles on public share links
This commit is contained in:
@@ -52,6 +52,7 @@ const renderApp = async (ctx: Context, next: Next, title = "Outline") => {
|
|||||||
return next();
|
return next();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const { shareId } = ctx.params;
|
||||||
const page = await readIndexFile(ctx);
|
const page = await readIndexFile(ctx);
|
||||||
const environment = `
|
const environment = `
|
||||||
window.env = ${JSON.stringify(presentEnv(env))};
|
window.env = ${JSON.stringify(presentEnv(env))};
|
||||||
@@ -60,7 +61,7 @@ const renderApp = async (ctx: Context, next: Next, title = "Outline") => {
|
|||||||
.toString()
|
.toString()
|
||||||
.replace(/\/\/inject-env\/\//g, environment)
|
.replace(/\/\/inject-env\/\//g, environment)
|
||||||
.replace(/\/\/inject-title\/\//g, title)
|
.replace(/\/\/inject-title\/\//g, title)
|
||||||
.replace(/\/\/inject-prefetch\/\//g, prefetchTags)
|
.replace(/\/\/inject-prefetch\/\//g, shareId ? "" : prefetchTags)
|
||||||
.replace(/\/\/inject-slack-app-id\/\//g, process.env.SLACK_APP_ID || "");
|
.replace(/\/\/inject-slack-app-id\/\//g, process.env.SLACK_APP_ID || "");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,6 @@
|
|||||||
"Templatize": "Templatize",
|
"Templatize": "Templatize",
|
||||||
"Create template": "Create template",
|
"Create template": "Create template",
|
||||||
"Home": "Home",
|
"Home": "Home",
|
||||||
"Search": "Search",
|
|
||||||
"Search documents for \"{{searchQuery}}\"": "Search documents for \"{{searchQuery}}\"",
|
"Search documents for \"{{searchQuery}}\"": "Search documents for \"{{searchQuery}}\"",
|
||||||
"Drafts": "Drafts",
|
"Drafts": "Drafts",
|
||||||
"Templates": "Templates",
|
"Templates": "Templates",
|
||||||
@@ -123,6 +122,7 @@
|
|||||||
"Choose icon": "Choose icon",
|
"Choose icon": "Choose icon",
|
||||||
"Loading": "Loading",
|
"Loading": "Loading",
|
||||||
"Loading editor": "Loading editor",
|
"Loading editor": "Loading editor",
|
||||||
|
"Search": "Search",
|
||||||
"Default access": "Default access",
|
"Default access": "Default access",
|
||||||
"View and edit": "View and edit",
|
"View and edit": "View and edit",
|
||||||
"View only": "View only",
|
"View only": "View only",
|
||||||
|
|||||||
Reference in New Issue
Block a user