Hide Potentially Dangerous Information Using helmet.hidePoweredBy() - fails despite multiple change to the code

Tell us what’s happening:

Hello. I have an issue with this test: Hide Potentially Dangerous Information Using helmet.hidePoweredBy() First there were _headers issues. I was receiving the deprecation caution. Replaced them in server.js file with getHeaders(). Did search this forum and others for possible solutions and applied some of them to my code. The test still fails. Some say Node.js version should be lower than 12.0.0. I didn’t uninstall my Node yet.
Help me solve this.
P.S. freeCodeCamp won’t let me login from Chrome Browser, I’m using Mozilla for fCC and Chrome for repl/glitch.

Your project link(s)

solution: https://boilerplate-infosec.malikaefremova.repl.co

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0.

Challenge: Hide Potentially Dangerous Information Using helmet.hidePoweredBy()

Link to the challenge:

Could you link to your code?

Not sure if there was something changed in the meantime, but I was able to make test pass by using your link to the project.

var express = require('express');
var app = express();
// app.disable('x-powered-by');

var helmet = require('helmet');
// app.use(helmet.contentSecurityPolicy({
//     directives: { defaultSrc: ["'self'"], scriptSrc: ["'self'"], styleSrc:["'self'"] }
//   }));

app.use(helmet.hidePoweredBy());






module.exports = app;
var api = require('./server.js');
app.use(express.static('public'));
app.disable('strict-transport-security');
app.use('/_api', api);
app.get("/", function (request, response) {
  response.sendFile(__dirname + '/views/index.html');
});
var listener = app.listen(process.env.PORT || 3000, function () {
  console.log('Your app is listening on port ' + listener.address().port);
});

yeah, it passed as well… all of a sudden. guess it was fcc issue. happens from time to time + this time I was able to login from chrome too. thanks anyway :heart: