hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1782238 - /httpcomponents/httpclient/branches/4.5.x/httpclient/src/main/java/org/apache/http/client/utils/URIBuilder.java
Date Wed, 08 Feb 2017 19:37:31 GMT
Author: olegk
Date: Wed Feb  8 19:37:31 2017
New Revision: 1782238

URL: http://svn.apache.org/viewvc?rev=1782238&view=rev
Log:
HTTPCLIENT-1810: When path is null or '', URIBuilder.toString() return '' rather than '/'.
Contributed by CuiBaosen <baosencumt at 126.com>

Modified:
    httpcomponents/httpclient/branches/4.5.x/httpclient/src/main/java/org/apache/http/client/utils/URIBuilder.java

Modified: httpcomponents/httpclient/branches/4.5.x/httpclient/src/main/java/org/apache/http/client/utils/URIBuilder.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.5.x/httpclient/src/main/java/org/apache/http/client/utils/URIBuilder.java?rev=1782238&r1=1782237&r2=1782238&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.5.x/httpclient/src/main/java/org/apache/http/client/utils/URIBuilder.java
(original)
+++ httpcomponents/httpclient/branches/4.5.x/httpclient/src/main/java/org/apache/http/client/utils/URIBuilder.java
Wed Feb  8 19:37:31 2017
@@ -37,6 +37,7 @@ import org.apache.http.Consts;
 import org.apache.http.NameValuePair;
 import org.apache.http.conn.util.InetAddressUtils;
 import org.apache.http.message.BasicNameValuePair;
+import org.apache.http.util.TextUtils;
 
 /**
  * Builder for {@link URI} instances.
@@ -492,8 +493,8 @@ public class URIBuilder {
 
     private static String normalizePath(final String path) {
         String s = path;
-        if (s == null) {
-            return "/";
+        if (TextUtils.isBlank(s)) {
+            return "";
         }
         int n = 0;
         for (; n < s.length(); n++) {



Mime
View raw message