Skip to content

Commit 33dead3

Browse files
committed
Only enable server-side rendering when:
1. No authentication is enabled 2. The server runs in SB_READ_ONLY mode
1 parent efdb54d commit 33dead3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

server/serverside_render.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ export async function renderHtmlPage(
1919
): Promise<Response> {
2020
let html = "";
2121
let lastModified = utcDateString(Date.now());
22-
if (!options.auth) {
23-
// Only attempt server-side rendering when this site is not protected by auth
22+
if (!options.auth && options.readOnly) {
23+
// Only attempt server-side rendering when this site is not protected by auth and running in read-only mode
2424
if (!looksLikePathWithExtension(pageName)) {
2525
try {
2626
const { data, meta } = await spacePrimitives.readFile(

0 commit comments

Comments
 (0)