Skip to content

Commit

Permalink
Make server helmet optional
Browse files Browse the repository at this point in the history
  • Loading branch information
skodapetr committed Mar 24, 2021
1 parent c58a9fb commit aab0f2f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const YAML = require("yaml");
"port": configuration["port"],
"serveStaticContent": configuration["serve-static-content"] || false,
"providers": configuration["providers"] || [],
"helmet": configuration["helmet"] || {},
"helmet": configuration["helmet"],
/**
* As this is provided to the profile, it may have custom properties
* so we only do some basic sanitization.
Expand Down
4 changes: 3 additions & 1 deletion server/production/server-production.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ const httpApi = require("../http-api/http-api");
*/
(function main() {
const app = express();
app.use(helmet(config.helmet));
if (config.helmet !== undefined) {
app.use(helmet(config.helmet));
}
if (config.serveStaticContent) {
initializeStatic(app, express);
}
Expand Down

0 comments on commit aab0f2f

Please sign in to comment.