diff --git a/src/node/hooks/express/webaccess.ts b/src/node/hooks/express/webaccess.ts index 10547b046..b5dad43a0 100644 --- a/src/node/hooks/express/webaccess.ts +++ b/src/node/hooks/express/webaccess.ts @@ -49,8 +49,20 @@ exports.userCanModify = (padId: string, req: SocketClientRequest) => { // Exported so that tests can set this to 0 to avoid unnecessary test slowness. exports.authnFailureDelayMs = 1000; +const staticResources = [ + /^\/padbootstrap-[a-zA-Z0-9]+\.min\.js$/, + /^\/manifest.json$/ +] + const checkAccess = async (req:any, res:any, next: Function) => { const requireAdmin = req.path.toLowerCase().startsWith('/admin-auth'); + for (const staticResource of staticResources) { + if (req.path.match(staticResource)) { + console.log(`Loading [${staticResource}] ${req.path}`); + return next() + } + } + // /////////////////////////////////////////////////////////////////////////////////////////////// // Step 1: Check the preAuthorize hook for early permit/deny (permit is only allowed for non-admin