HTTPCLIENT-1556: Default CookieSpecs provider not found for AbstractHttpClient subclass

Contributed by Timo Kinnunen <timo.kinnunen at gmail.com>

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1629134 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Oleg Kalnichevski 2014-10-03 08:14:29 +00:00
parent b47a2333bf
commit 526a8c51fc
1 changed files with 4 additions and 0 deletions

View File

@ -53,6 +53,7 @@ import org.apache.http.client.RedirectHandler;
import org.apache.http.client.RedirectStrategy;
import org.apache.http.client.RequestDirector;
import org.apache.http.client.UserTokenHandler;
import org.apache.http.client.config.CookieSpecs;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.params.AuthPolicy;
@ -371,6 +372,9 @@ public abstract class AbstractHttpClient extends CloseableHttpClient {
protected CookieSpecRegistry createCookieSpecRegistry() {
final CookieSpecRegistry registry = new CookieSpecRegistry();
registry.register(
CookieSpecs.DEFAULT,
new BestMatchSpecFactory());
registry.register(
CookiePolicy.BEST_MATCH,
new BestMatchSpecFactory());