diff --git a/package.json b/package.json index f29737989..4674e963f 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "dev": "pnpm -r prepack && pnpm start:dev", "dev:cloud": "pnpm -r prepack && pnpm start:dev:cloud", "start:dev": "pnpm -r --parallel --filter=!@logto/integration-tests --filter=!@logto/cloud dev", - "start:dev:cloud": "CONSOLE_PUBLIC_URL=/ pnpm -r --parallel --filter=!@logto/integration-tests dev", + "start:dev:cloud": "CONSOLE_PUBLIC_URL=/ IS_CLOUD=1 pnpm -r --parallel --filter=!@logto/integration-tests dev", "start": "cd packages/core && NODE_ENV=production node .", "start:cloud": "cd packages/cloud && NODE_ENV=production node .", "cli": "logto", diff --git a/packages/cloud/src/middleware/with-spa.ts b/packages/cloud/src/middleware/with-spa.ts index e54b003b1..69d6c6231 100644 --- a/packages/cloud/src/middleware/with-spa.ts +++ b/packages/cloud/src/middleware/with-spa.ts @@ -73,6 +73,7 @@ export default function withSpa({ 'Content-Type': mime.lookup(pathLike), 'Last-Modified': stat.mtime.toUTCString(), 'Cache-Control': `max-age=${maxAge}`, + ETag: `"${stat.size.toString(16)}-${stat.mtimeMs.toString(16)}"`, }, stream: createReadStream(pathLike), status: 200, @@ -80,12 +81,6 @@ export default function withSpa({ }; } -const normalize = (pathLike: string) => { - const value = path.normalize(pathLike); - - return value.length > 1 && value.endsWith('/') ? value.slice(0, -1) : value; -}; - const tryStat = async (pathLike: string) => { try { const stat = await fs.stat(pathLike);