Hi,
Apparently, this is the behaviour of the client.
I did something like that, in order to copy the “Range” header:
builder.setRedirectStrategy(new DefaultRedirectStrategy() {
@Override
public HttpUriRequest getRedirect(HttpRequest request,
HttpResponse response, HttpContext context) throws ProtocolException {
HttpUriRequest redirectRequest = super.getRedirect(request,
response, context);
// copy "Range" headers, if exist
Header[] rangeHeaders =
request.getHeaders(HttpHeaders.RANGE);
if (rangeHeaders != null) {
for (Header header : rangeHeaders) {
redirectRequest.addHeader(header);
}
}
return redirectRequest;
}
});
Hope it’s the correct approach.
--
Yoram Dayagi (Gmail)
Sent with Airmail
On April 1, 2014 at 12:15:58 PM, Lukáš Křečan ([email protected]) wrote:
Hi,
I am using httpasyncclient 4.0.1 and I am setting custom Accept
header. The server returns 302 redirect, the client correctly follows
the location header and sends redirect. The trouble is, that Accept
header from the original request is not copied to the redirect so the
server returns unexpected Content-Type. Is it a bug or am I doing
something work?
Cheers
Lukas
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]