Tell us what’s happening:
Describe your issue in detail here.
What are the second instructions?
Your code so far
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36
Challenge: Information Security with HelmetJS - Hide Potentially Dangerous Information Using helmet.hidePoweredBy()
Link to the challenge:
Do you mean this?
Use the helmet.hidePoweredBy() middleware to remove the X-Powered-By header.
Remember how you used other Express middleware?
app.use(someMiddleware)
That is how you should use the helmet.hidePoweredBy() middleware.
Edit:
You need to require in helmet.
You need to app.use() the helmet.hidePoweredBy() middleware.
what is the somemiddleware code? but inevitable yes
The helmet.hidePoweredBy() middleware.
You learn how to use middleware here.
Learn to Code — For Free
Here is an example of using the cors middleware.
const cors = require('cors');
app.use(cors());
It is the same principle for how you should use the helmet.hidePoweredBy() middleware.
That didn’t help, I tried everything and no luck.
All I see is this
https://replit.com/@borristheclown2/boilerplate-infosec-10?v=1#myApp.js
Which is not correct and not what I said to do. Update your Replit with your latest code if that isn’t it.
You need to require in helmet.
You need to put the helmet.hidePoweredBy() middleware call inside the app.use() call.
const theMiddleware = require('theMiddleware');
app.use(theMiddleware.theMethod());
I did it, is this correct?
lasjorg
October 10, 2023, 8:35pm
12
How do you do what?
You bring in helmet the same way you bring in express.
https://web.archive.org/web/20200414213516/https://helmetjs.github.io/docs/hide-powered-by/
Have you done the JS curriculum and the Back End Development and APIs sections? Because there is really nothing new going on here, just a new library and its usage.
no and its still not working.
lasjorg
October 15, 2023, 6:52pm
15
What is it you believe app is in your code? How can you call something that doesn’t exist in the code?
You remove the Express code which is required to use Express.
const express = require('express');
const app = express();
system
Closed
April 15, 2024, 6:52am
16
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.