NIFI-1714 use standard HttpClient cookie policy instead of default

Signed-off-by: jpercivall <joepercivall@yahoo.com>
This commit is contained in:
Mike Moser 2016-03-31 16:05:38 -04:00 committed by jpercivall
parent 9f7dba491f
commit 1c025dd4be
1 changed files with 2 additions and 0 deletions

View File

@ -49,6 +49,7 @@ import org.apache.http.HttpResponse;
import org.apache.http.auth.AuthScope; import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials; import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.CredentialsProvider; import org.apache.http.client.CredentialsProvider;
import org.apache.http.client.config.CookieSpecs;
import org.apache.http.client.config.RequestConfig; import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpGet;
import org.apache.http.config.Registry; import org.apache.http.config.Registry;
@ -361,6 +362,7 @@ public class GetHTTP extends AbstractSessionFactoryProcessor {
requestConfigBuilder.setRedirectsEnabled(false); requestConfigBuilder.setRedirectsEnabled(false);
requestConfigBuilder.setSocketTimeout(context.getProperty(DATA_TIMEOUT).asTimePeriod(TimeUnit.MILLISECONDS).intValue()); requestConfigBuilder.setSocketTimeout(context.getProperty(DATA_TIMEOUT).asTimePeriod(TimeUnit.MILLISECONDS).intValue());
requestConfigBuilder.setRedirectsEnabled(context.getProperty(FOLLOW_REDIRECTS).asBoolean()); requestConfigBuilder.setRedirectsEnabled(context.getProperty(FOLLOW_REDIRECTS).asBoolean());
requestConfigBuilder.setCookieSpec(CookieSpecs.STANDARD);
// build the http client // build the http client
final HttpClientBuilder clientBuilder = HttpClientBuilder.create(); final HttpClientBuilder clientBuilder = HttpClientBuilder.create();