Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

248
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda