On Wed, 2025-09-03 at 08:05 +0000, Stankov. Yavor wrote:
> Hi,
> 
> I spent some time debugging and I actually found that the problem is
> that the proxy is not configured properly and because of this the
> request never gets through it.
> 
> We are using the RequestConfig#setProxy to set it (which is
> deprecated it seems) and after this we set the Request config to the
> context like - 
> exec.getCntx().setAttribute(HttpClientContext.REQUEST_CONFIG,
> reqConfig); which again seems is deprecated.
> 
> Later we have a custom HttpRoutePlanner which in the HTTP case falls
> back to the SystemDefaultRoutePlanner where I see that we try to get
> the proxy from the config but this proxy is null.
> 
> So what should the appropriate way to config the proxy now?

You should use DefaultProxyRoutePlanner if you have a single fixed
proxy, SystemDefaultRoutePlanner if you want to be using the system
proxy selector or a custom HttpRoutePlanner if you have a more complex
request routing logic.

Please also note RequestConfig#setProxy will be un-deprecated in 5.5.1
and 5.6, so you can also use it and ignore the deprecation warning for
now.

Hope this helps

Oleg



>  Should I directly use the HTTPClientContext setter to set the
> request config? We currently use the HTTPContext interface which
> doesn't have the setters and getters, only the attribute ones, so
> should we change this to use the HTTPClientContext? Is this the only
> implementation that is going to be used in the future?
> 
> Best Regards,
> Yavor 
> 
> P.S. It is not possible for me to provide any unit tests or a way to
> reproduce this, but I'll try to be more descriptive in the future.
> 
> 
> 
> -----Original Message-----
> From: Gary Gregory <garydgreg...@gmail.com> 
> Sent: Monday, September 1, 2025 7:54 PM
> To: HttpClient User Discussion <httpclient-users@hc.apache.org>
> Subject: Re: Via and Vary headers are missing from the received
> response after update from HTTP Client 5.3.1 to 5.5
> 
> I think a failing unit test, or some kind of a reproducer, will help
> move things along.
> 
> Gary
> 
> On Mon, Sep 1, 2025, 07:29 Stankov. Yavor <y.stan...@seeburger.com>
> wrote:
> 
> > Hi,
> > 
> > We just saw that after we updated to the latest Apache HTTP Client 
> > version, our tests started failing because the Via and Vary headers
> > are missing from the response of the test cases where a proxy is
> > used 
> > in between the client and the server. There is nothing changed on
> > the 
> > proxy side nor on the server side. The tests are still passing if
> > we 
> > use an older version of the Apache HTTP Client.
> > 
> > Do you have any idea what might be causing this.
> > 
> > I just saw this entry in the release notes but I'm not sure what
> > this 
> > optimization is about -> HTTPCLIENT-2293: Via header protocol 
> > improvements and performance optimization.
> > 
> > Best Regards,
> > Yavor
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
> For additional commands, e-mail: httpclient-users-h...@hc.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
For additional commands, e-mail: httpclient-users-h...@hc.apache.org

Reply via email to