Skip to content

Commit

Permalink
Add Document-Isolation-Policy header
Browse files Browse the repository at this point in the history
  • Loading branch information
ydogandjiev committed Oct 3, 2024
1 parent 18e5956 commit d819d52
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,29 @@ var express = require('express');
var serveStatic = require('serve-static');

var app = express();
app.use(serveStatic(__dirname + '/public', {

app.use('/index.html', serveStatic(__dirname + '/public/index.html', {
setHeaders: (res, path) => {
res.setHeader('Cache-Control', 'no-cache, no-store, must-revalidate');
res.setHeader('Document-Isolation-Policy', 'isolate-and-require-corp');
}
}));

app.use('/page1', serveStatic(__dirname + '/public/page1.html', {
setHeaders: (res, path) => {
res.setHeader('Cache-Control', 'no-cache, no-store, must-revalidate');
res.setHeader('Document-Isolation-Policy', 'isolate-and-require-corp');
}
}));

app.use('/page2', serveStatic(__dirname + '/public/page2.html', {
setHeaders: (res, path) => {
res.setHeader('Cache-Control', 'no-cache, no-store, must-revalidate');
res.setHeader('Document-Isolation-Policy', 'isolate-and-require-corp');
}
}));

app.use(serveStatic(__dirname + '/public', {
setHeaders: (res, path) => {
res.setHeader('Cache-Control', 'no-cache, no-store, must-revalidate');
}
Expand Down

0 comments on commit d819d52

Please sign in to comment.