[Done] Hide Potentially Dangerous Information Using helmet.hidePoweredBy()

[Done] Hide Potentially Dangerous Information Using helmet.hidePoweredBy()
0.0 0

#1

As per the first challenge, I installed helmetJS

	"dependencies": {
		"express": "^4.14.0",
    "helmet": "^3.12.1"
	},

and then required it:

var helmet = require('helmet');

But when I run:

app.use(helmet.hidePoweredBy());

I get the following error from the freeCodeCamp page:
// running test
expected ‘Express’ to not equal ‘Express’
// tests completed

I’m inclined to think I’ve made a mistake rather than there being a glitch, but I copy and pasted the code from the module’s page on github. I’ve tried using a few different versions of the package, but no luck there.

Any thoughts?


#2

I’m guessing there was a backend glitch that got fixed. I went back today, ran the same code and it passed.


#3

First please share the challenge code, plus the full code you tried and failed.

Beside
This could be about one very small issue(but I’m not sure), my guess, since another user had the same issue recently, you may check it here

This could be becasue you copied some text which is based on UTF-8, and the test expected ASCII, you may remove following

"dependencies": {
		"express": "^4.14.0",
    "helmet": "^3.12.1"
	},

And just type it(no copy paste), hope this help.


#4

Thanks for getting back to me.

I mentioned it above, but coming back to the same challenge two days later, the code ran and passed the test on the first try. I ran it 2-3 more times to make sure it’s not a fluke. Maybe something got updated in the intervening time?

I will keep your comments in mind though for future problems!


#5

Same issue here. It wasn’t passing with the same error log then I tried again 5 minutes later and it worked.