Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

394
Visualizações
How to disable "X-Powered-By" response header in create-react-app?

I'm working on a react.js app using Create-react-app, in the response headers I'm seeing an Express's x-powered-by header and I want to disable this particular header field. Are there ways to achieve this? In the Next.js we can disable this header field by adding some code to config file, can we achieve the same in my scenario?

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

React is a client side framework and doesn't handle serving your application to a browser. Whatever system you are using to host your application is responsible for that header. Some of the CRA templates use webpack-dev-server for npm start which is built on Express and is probably what's showing the header. As this isn't actually part of your app, there isn't much point to turning it off even if you can.

about 4 years ago · Juan Pablo Isaza Relatório

0

I'd suggest having a look at helmet, this will remove the x-powered-by header as well as enhancing security by setting other http headers (see docs. for details)

const express = require("express");
const helmet = require("helmet");

const app = express();

app.use(helmet());

app.get("/test", (req, resp) => { 
    resp.send('Testing with Helmet');
})

app.listen(3000);

You'll see when you use helmet that the X-Powered-By: Express header is no longer present.

If you just want to hide the x-powered-by header, I'd suggest trying:

const express = require("express");
const helmet = require("helmet");

const app = express();

app.use(helmet.hidePoweredBy());

app.get("/test", (req, resp) => { 
    resp.send('Testing with Helmet');
})

app.listen(3000);
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda