You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2011/05/07 15:49:00 UTC
svn commit: r1100535 - in
/httpcomponents/httpclient/branches/4.1.x/httpclient: ./
src/main/java/org/apache/http/impl/conn/DefaultHttpRoutePlanner.java
src/test/java/org/apache/http/client/protocol/TestRedirects.java
Author: olegk
Date: Sat May 7 13:48:59 2011
New Revision: 1100535
URL: http://svn.apache.org/viewvc?rev=1100535&view=rev
Log:
Bogus redirects should result in an HttpException instead of IllegalStateException (merged from trunk)
Modified:
httpcomponents/httpclient/branches/4.1.x/httpclient/ (props changed)
httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/impl/conn/DefaultHttpRoutePlanner.java
httpcomponents/httpclient/branches/4.1.x/httpclient/src/test/java/org/apache/http/client/protocol/TestRedirects.java
Propchange: httpcomponents/httpclient/branches/4.1.x/httpclient/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat May 7 13:48:59 2011
@@ -1,4 +1,4 @@
/httpcomponents/httpclient/branches/4.0.x/httpclient:950681-950688
/httpcomponents/httpclient/branches/branch_4_1/httpclient:755593-811107
/httpcomponents/httpclient/branches/notice-plugin-test/httpclient:1024348-1031454
-/httpcomponents/httpclient/trunk/httpclient:1087358,1088000-1088004,1091140-1091141,1091904
+/httpcomponents/httpclient/trunk/httpclient:1087358,1088000-1088004,1091140-1091141,1091904,1100531-1100533
Modified: httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/impl/conn/DefaultHttpRoutePlanner.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/impl/conn/DefaultHttpRoutePlanner.java?rev=1100535&r1=1100534&r2=1100535&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/impl/conn/DefaultHttpRoutePlanner.java (original)
+++ httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/impl/conn/DefaultHttpRoutePlanner.java Sat May 7 13:48:59 2011
@@ -108,7 +108,12 @@ public class DefaultHttpRoutePlanner imp
final HttpHost proxy =
ConnRouteParams.getDefaultProxy(request.getParams());
- final Scheme schm = schemeRegistry.getScheme(target.getSchemeName());
+ final Scheme schm;
+ try {
+ schm = schemeRegistry.getScheme(target.getSchemeName());
+ } catch (IllegalStateException ex) {
+ throw new HttpException(ex.getMessage());
+ }
// as it is typically used for TLS/SSL, we assume that
// a layered scheme implies a secure connection
final boolean secure = schm.isLayered();
Modified: httpcomponents/httpclient/branches/4.1.x/httpclient/src/test/java/org/apache/http/client/protocol/TestRedirects.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.1.x/httpclient/src/test/java/org/apache/http/client/protocol/TestRedirects.java?rev=1100535&r1=1100534&r2=1100535&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.1.x/httpclient/src/test/java/org/apache/http/client/protocol/TestRedirects.java (original)
+++ httpcomponents/httpclient/branches/4.1.x/httpclient/src/test/java/org/apache/http/client/protocol/TestRedirects.java Sat May 7 13:48:59 2011
@@ -586,7 +586,7 @@ public class TestRedirects extends Basic
}
}
- @Test(expected=IllegalStateException.class)
+ @Test(expected=ClientProtocolException.class)
public void testRejectBogusRedirectLocation() throws Exception {
this.localServer.register("*", new BogusRedirectService("xxx://bogus"));