mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2025-04-17 18:18:11 +00:00
Prevent i-framing of frontend UI to prevent unsafe embedding and/or clickjacking (#1200)
Prevent iframing of frontend UI to prevent unsafe embedding and/or clickjacking
This commit is contained in:
parent
42e1d8e8ce
commit
e61dfd80a5
1 changed files with 8 additions and 1 deletions
|
@ -56,7 +56,14 @@ embeddedEndpoints(apiRouter);
|
|||
|
||||
if (process.env.NODE_ENV !== "development") {
|
||||
app.use(
|
||||
express.static(path.resolve(__dirname, "public"), { extensions: ["js"] })
|
||||
express.static(path.resolve(__dirname, "public"), {
|
||||
extensions: ["js"],
|
||||
setHeaders: (res) => {
|
||||
// Disable I-framing of entire site UI
|
||||
res.removeHeader("X-Powered-By");
|
||||
res.setHeader("X-Frame-Options", "DENY");
|
||||
},
|
||||
})
|
||||
);
|
||||
|
||||
app.use("/", function (_, response) {
|
||||
|
|
Loading…
Add table
Reference in a new issue