hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lucas Ventura Carro <useyour.m...@gmail.com>
Subject Location based RedirectStrategy
Date Mon, 16 Jan 2017 12:22:43 GMT
I wanted to develop an specific RedirectStrategy, which will accept the
redirect based on the location URI returned in response.

So my idea was to override the 'isRedirected' method and, retrieve the URI
with 'getLocationURI', decide redirection based on this value and a fixed
set -- as method 'isRedirectable' doesn't fit my needs.

But when reviewing the code from DefaultRedirectStrategy.getLocation[1]
I've realized that each time is called, it will store the URI in the
current request context.
Is this correct? Should not this be done on the caller method 'getRedirect'
instead? As 'getLocation' seems more calculating, than doing the
redirection itself.

    [1]:
https://hc.apache.org/httpcomponents-client-ga/httpclient/xref/org/apache/http/impl/client/DefaultRedirectStrategy.html#122

--
Lucas

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message