u
This commit is contained in:
@@ -60,8 +60,11 @@ function corsMiddleware(req, res, next) {
|
||||
async function createApi() {
|
||||
const app = express();
|
||||
|
||||
app.use((_req, res, next) => {
|
||||
res.setHeader('Cache-Control', 'no-store');
|
||||
app.use((req, res, next) => {
|
||||
// Do not attach no-store to SSE endpoint
|
||||
if (req.path !== '/api/events') {
|
||||
res.setHeader('Cache-Control', 'no-store');
|
||||
}
|
||||
next();
|
||||
});
|
||||
app.use(corsMiddleware);
|
||||
|
||||
Reference in New Issue
Block a user