feat: prevent from being used in iframe
This commit is contained in:
@@ -10,7 +10,12 @@ const webUIHandler = async (app: Application) => {
|
|||||||
const indexHtml = join(dirname(webAppPath), 'build', 'index.html');
|
const indexHtml = join(dirname(webAppPath), 'build', 'index.html');
|
||||||
|
|
||||||
app.use(express.static(webBuildPath));
|
app.use(express.static(webBuildPath));
|
||||||
app.get('*', (_req, res) => res.sendFile(indexHtml));
|
app.get('*', (_req, res) => {
|
||||||
|
res.set('Content-Security-Policy', 'frame-ancestors: none;');
|
||||||
|
res.set('X-Frame-Options', 'DENY');
|
||||||
|
|
||||||
|
res.sendFile(indexHtml);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export default webUIHandler;
|
export default webUIHandler;
|
||||||
|
Reference in New Issue
Block a user