Skip to content

Commit

Permalink
Merge pull request #283 from vbhayden/add-mime-sniff-header
Browse files Browse the repository at this point in the history
Adding Optional Header to Prevent MIME Sniffing
  • Loading branch information
Lomilar authored Sep 27, 2023
2 parents ed330a6 + b8ae1d4 commit 368a6d1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,13 @@ if (process.env.INCLUDE_STRICT_TRANSPORT_SECURITY_HEADER == "true") {
});
}

if (process.env.INCLUDE_MIME_NOSNIFF_HEADER == "true") {
app.use((req, res, next) => {
res.setHeader("X-Content-Type-Options", "nosniff");
next();
});
}

let v8 = require('v8');
let glob = require('glob');
let path = require('path');
Expand Down

0 comments on commit 368a6d1

Please sign in to comment.