3

What I want to just remove x-powered-by with the help of Helmet (npm package) I have microservice in node js. here is what I am doing.

import { micro, IMicroService } from "@artlife/micro";
import * as helmet from "helmet";
const service = micro();
service.expressApp.use(helmet());

Helmet default remove the x-power-by header but in my case, it is not doing. I have reinstalled everything and done with browser cache clearing. everything work if I do service.expressApp.disable("x-powered-by");. even service.expressApp.use(helmet.hidePoweredBy())is not working. no error in the console.

Is there any other config for helmet that I have to do?

if it doesn't work I have backup plan with thisservice.expressApp.disable("x-powered-by");

Pardeep
  • 2,153
  • 1
  • 17
  • 37

0 Answers0