From cffb877b1e0e755c7620f4d46015c7a80991d0f4 Mon Sep 17 00:00:00 2001 From: Oleg Kalnichevski Date: Mon, 8 Sep 2014 07:57:20 +0000 Subject: [PATCH] Ignore unsupported cookie policies Contributed by Dmitry Potapov git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1623316 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/http/client/protocol/RequestAddCookies.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/httpclient/src/main/java/org/apache/http/client/protocol/RequestAddCookies.java b/httpclient/src/main/java/org/apache/http/client/protocol/RequestAddCookies.java index 1e002d25c..3f4c016b2 100644 --- a/httpclient/src/main/java/org/apache/http/client/protocol/RequestAddCookies.java +++ b/httpclient/src/main/java/org/apache/http/client/protocol/RequestAddCookies.java @@ -148,7 +148,11 @@ public class RequestAddCookies implements HttpRequestInterceptor { // Get an instance of the selected cookie policy final CookieSpecProvider provider = registry.lookup(policy); if (provider == null) { - throw new HttpException("Unsupported cookie policy: " + policy); + if (this.log.isDebugEnabled()) { + this.log.debug("Unsupported cookie policy: " + policy); + } + + return; } final CookieSpec cookieSpec = provider.create(clientContext); // Get all cookies available in the HTTP state