hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karl Wright <daddy...@gmail.com>
Subject Re: Redirection not happening?
Date Tue, 16 Feb 2016 22:03:04 GMT
Oh, FWIW, this is httpcomponents/httpclient 4.4.1.
Karl


On Tue, Feb 16, 2016 at 4:58 PM, Karl Wright <daddywri@gmail.com> wrote:

> Hi folks,
>
> The ManifoldCF SharePoint connector has the following code to set up its
> HttpClient instance:
>
> >>>>>>
>       RequestConfig.Builder requestBuilder = RequestConfig.custom()
>           .setCircularRedirectsAllowed(true)
>           .setSocketTimeout(socketTimeout)
>           .setExpectContinueEnabled(false)
>           .setConnectTimeout(connectionTimeout)
>           .setConnectionRequestTimeout(socketTimeout);
>
>       // If there's a proxy, set that too.
>       if (proxyHost != null && proxyHost.length() > 0)
>       {
>
>         // Configure proxy authentication
>         if (proxyUsername != null && proxyUsername.length() > 0)
>         {
>           if (proxyPassword == null)
>             proxyPassword = "";
>           if (proxyDomain == null)
>             proxyDomain = "";
>
>           credentialsProvider.setCredentials(
>             new AuthScope(proxyHost, proxyPort),
>             new NTCredentials(proxyUsername, proxyPassword, currentHost,
> proxyDomain));
>         }
>
>         HttpHost proxy = new HttpHost(proxyHost, proxyPort);
>
>         requestBuilder.setProxy(proxy);
>       }
>
>       HttpClientBuilder builder = HttpClients.custom()
>         .setConnectionManager(connectionManager)
>         .disableAutomaticRetries()
>         .setDefaultRequestConfig(requestBuilder.build())
>         .setDefaultCredentialsProvider(credentialsProvider);
>       builder.setRequestExecutor(new HttpRequestExecutor(socketTimeout))
>         .setRedirectStrategy(new DefaultRedirectStrategy());
>       httpClient = builder.build();
> <<<<<<
>
> This works fine for the most part, except for one thing: it apparently
> doesn't follow 302 redirections, for some reason.  Any idea why?
>
> Thanks in advance,
> Karl
>
>

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