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

253
Visualizações
Why is the 'Host' header set to incorrect value upon receiving a 301 status response

I am facing an issue while using the Apache components client 4.5.5. My use case is as follows:

  1. Http-client is configured to connect to http-server1 with host1 and port 8888. Both the http-client and the server1 are running on the same machine.
  2. The http-server1 is suppose to give a 301 status code and is configured with the location pointing to http-server2 with host2 and port 8888. Http-server2 is running on a different machine.
  3. When the Http-client receives this response from server1, it creates another request with URI as mentioned in the "location" header but it still uses the host1 for the request instead of host2.
  4. As a result of this, the redirected http request fails with a 400 status code.

Please help in pointing out what might be causing this or if this is an expected behaviour to keep the host unchanged? If not then Can anyone also suggest any methods that can be used to change the host header in the second request!

Thanks in advance.

over 4 years ago · Santiago Trujillo
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