code: private void setupClient(final AbstractHttpClient client) {
  		this.client.addResponseInterceptor(new HttpResponseInterceptor() {
  			@Override
  			public void process(final HttpResponse response, final HttpContext context)
  					throws HttpException, IOException {
  				Header header = response.getFirstHeader("Location");
  				if (header!=null)
  					context.setAttribute("Location", header.getValue());
  			}
  		});
  	}
docs: This method is used to capture Location headers after HttpClient redirect handling.