Mounting for "Hide Potentially Dangerous Information Using helmet.hidePoweredBy()"

Mounting for "Hide Potentially Dangerous Information Using helmet.hidePoweredBy()"
0

#1

I’ve included the following code:

var express = require('express');
var helmet = require('helmet');
var app = express();
app.use(helmet());
app.use(helmet.hidePoweredBy());

but it returns “expected [] to include ‘hidePoweredBy’” and “helmet.hidePoweredBy() middleware should be mounted correctly”

I have no idea why this isn’t working. There are no errors in the glitch log.

Here’s my glitch: https://glitch.com/edit/#!/wholesale-entrance

I’ve tried reloading and clearing cache multiple times for both the test page and the glitch page.


#2

You’re not supposed to edit the server.js file. Place the appropriate helmet code at the top of myApp.js and it should work.