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 2021/02/06 12:33:15 UTC

[httpcomponents-client] branch master updated (0940d35 -> f9ea1b6)

This is an automated email from the ASF dual-hosted git repository.

olegk pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/httpcomponents-client.git.


    from 0940d35  Minor Improvement:
     new 004bc85  Upgraded HttpCore to version 5.1-beta3
     new af3a752  RFC 3986 conformance: re-use URIBuilder new functionality in URIUtils#normalizeSyntax
     new f9ea1b6  Upgraded project version to 5.1-beta1-SNAPSHOT

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 httpclient5-cache/pom.xml                          |  2 +-
 httpclient5-fluent/pom.xml                         |  2 +-
 httpclient5-testing/pom.xml                        |  2 +-
 httpclient5-win/pom.xml                            |  2 +-
 httpclient5/pom.xml                                |  2 +-
 .../org/apache/hc/client5/http/utils/URIUtils.java | 36 +++-------------------
 .../apache/hc/client5/http/utils/TestURIUtils.java |  8 ++---
 pom.xml                                            |  6 ++--
 8 files changed, 17 insertions(+), 43 deletions(-)


[httpcomponents-client] 03/03: Upgraded project version to 5.1-beta1-SNAPSHOT

Posted by ol...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

olegk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/httpcomponents-client.git

commit f9ea1b623853ba68f3e592296467980d577517b9
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Sat Feb 6 13:28:08 2021 +0100

    Upgraded project version to 5.1-beta1-SNAPSHOT
---
 httpclient5-cache/pom.xml   | 2 +-
 httpclient5-fluent/pom.xml  | 2 +-
 httpclient5-testing/pom.xml | 2 +-
 httpclient5-win/pom.xml     | 2 +-
 httpclient5/pom.xml         | 2 +-
 pom.xml                     | 4 ++--
 6 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/httpclient5-cache/pom.xml b/httpclient5-cache/pom.xml
index 5c5c271..0be12c4 100644
--- a/httpclient5-cache/pom.xml
+++ b/httpclient5-cache/pom.xml
@@ -28,7 +28,7 @@
   <parent>
     <groupId>org.apache.httpcomponents.client5</groupId>
     <artifactId>httpclient5-parent</artifactId>
-    <version>5.0.3-SNAPSHOT</version>
+    <version>5.1-beta1-SNAPSHOT</version>
   </parent>
   <artifactId>httpclient5-cache</artifactId>
   <name>Apache HttpClient Cache</name>
diff --git a/httpclient5-fluent/pom.xml b/httpclient5-fluent/pom.xml
index 67c1e46..cba8df9 100644
--- a/httpclient5-fluent/pom.xml
+++ b/httpclient5-fluent/pom.xml
@@ -28,7 +28,7 @@
   <parent>
     <groupId>org.apache.httpcomponents.client5</groupId>
     <artifactId>httpclient5-parent</artifactId>
-    <version>5.0.3-SNAPSHOT</version>
+    <version>5.1-beta1-SNAPSHOT</version>
   </parent>
   <artifactId>httpclient5-fluent</artifactId>
   <name>Apache HttpClient Fluent</name>
diff --git a/httpclient5-testing/pom.xml b/httpclient5-testing/pom.xml
index 4551dd4..3ea9a30 100644
--- a/httpclient5-testing/pom.xml
+++ b/httpclient5-testing/pom.xml
@@ -28,7 +28,7 @@
   <parent>
     <groupId>org.apache.httpcomponents.client5</groupId>
     <artifactId>httpclient5-parent</artifactId>
-    <version>5.0.3-SNAPSHOT</version>
+    <version>5.1-beta1-SNAPSHOT</version>
   </parent>
   <artifactId>httpclient5-testing</artifactId>
   <name>Apache HttpClient Integration Tests</name>
diff --git a/httpclient5-win/pom.xml b/httpclient5-win/pom.xml
index 60994c0..302d58c 100644
--- a/httpclient5-win/pom.xml
+++ b/httpclient5-win/pom.xml
@@ -28,7 +28,7 @@
   <parent>
     <groupId>org.apache.httpcomponents.client5</groupId>
     <artifactId>httpclient5-parent</artifactId>
-    <version>5.0.3-SNAPSHOT</version>
+    <version>5.1-beta1-SNAPSHOT</version>
   </parent>
   <artifactId>httpclient5-win</artifactId>
   <name>Apache HttpClient Windows features</name>
diff --git a/httpclient5/pom.xml b/httpclient5/pom.xml
index 833f7ba..eb27048 100644
--- a/httpclient5/pom.xml
+++ b/httpclient5/pom.xml
@@ -28,7 +28,7 @@
   <parent>
     <groupId>org.apache.httpcomponents.client5</groupId>
     <artifactId>httpclient5-parent</artifactId>
-    <version>5.0.3-SNAPSHOT</version>
+    <version>5.1-beta1-SNAPSHOT</version>
   </parent>
   <artifactId>httpclient5</artifactId>
   <name>Apache HttpClient</name>
diff --git a/pom.xml b/pom.xml
index 758aed1..f408742 100644
--- a/pom.xml
+++ b/pom.xml
@@ -33,7 +33,7 @@
   <groupId>org.apache.httpcomponents.client5</groupId>
   <artifactId>httpclient5-parent</artifactId>
   <name>Apache HttpComponents Client Parent</name>
-  <version>5.0.3-SNAPSHOT</version>
+  <version>5.1-beta1-SNAPSHOT</version>
   <description>Apache HttpComponents Client is a library of components for building client side HTTP services</description>
   <url>https://hc.apache.org/httpcomponents-client-5.0.x/${project.version}/</url>
   <inceptionYear>1999</inceptionYear>
@@ -48,7 +48,7 @@
     <connection>scm:git:https://gitbox.apache.org/repos/asf/httpcomponents-client.git</connection>
     <developerConnection>scm:git:https://gitbox.apache.org/repos/asf/httpcomponents-client.git</developerConnection>
     <url>https://github.com/apache/httpcomponents-client/tree/${project.scm.tag}</url>
-    <tag>5.0.3-SNAPSHOT</tag>
+    <tag>5.1-beta1-SNAPSHOT</tag>
   </scm>
 
  <distributionManagement>


[httpcomponents-client] 02/03: RFC 3986 conformance: re-use URIBuilder new functionality in URIUtils#normalizeSyntax

Posted by ol...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

olegk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/httpcomponents-client.git

commit af3a7526d2beb4baf7fe28c992e5974738496642
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Sat Feb 6 13:26:05 2021 +0100

    RFC 3986 conformance: re-use URIBuilder new functionality in URIUtils#normalizeSyntax
---
 .../org/apache/hc/client5/http/utils/URIUtils.java | 36 +++-------------------
 .../apache/hc/client5/http/utils/TestURIUtils.java |  8 ++---
 2 files changed, 9 insertions(+), 35 deletions(-)

diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/utils/URIUtils.java b/httpclient5/src/main/java/org/apache/hc/client5/http/utils/URIUtils.java
index 3fe9cf0..cfe8a35 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/utils/URIUtils.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/utils/URIUtils.java
@@ -32,9 +32,9 @@ import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Locale;
-import java.util.Stack;
 
 import org.apache.hc.core5.http.HttpHost;
+import org.apache.hc.core5.http.URIScheme;
 import org.apache.hc.core5.net.URIAuthority;
 import org.apache.hc.core5.net.URIBuilder;
 import org.apache.hc.core5.util.Args;
@@ -190,8 +190,7 @@ public class URIUtils {
     }
 
     /**
-     * Removes dot segments according to RFC 3986, section 5.2.4 and
-     * Syntax-Based Normalization according to RFC 3986, section 6.2.2.
+     * Removes dot segments and performs Syntax-Based Normalization.
      *
      * @param uri the original URI
      * @return the URI without dot segments
@@ -201,39 +200,14 @@ public class URIUtils {
             // opaque and file: URIs
             return uri;
         }
-        Args.check(uri.isAbsolute(), "Base URI must be absolute");
         final URIBuilder builder = new URIBuilder(uri);
-        if (!builder.isPathEmpty()) {
-            final List<String> inputSegments = builder.getPathSegments();
-            final Stack<String> outputSegments = new Stack<>();
-            for (final String inputSegment : inputSegments) {
-                if (!inputSegment.isEmpty() && !".".equals(inputSegment)) {
-                    if ("..".equals(inputSegment)) {
-                        if (!outputSegments.isEmpty()) {
-                            outputSegments.pop();
-                        }
-                    } else {
-                        outputSegments.push(inputSegment);
-                    }
-                }
-            }
-            if (!inputSegments.isEmpty()) {
-                final String lastSegment = inputSegments.get(inputSegments.size() - 1);
-                if (lastSegment.isEmpty()) {
-                    outputSegments.push("");
-                }
-            }
-            builder.setPathSegments(outputSegments);
+        builder.normalizeSyntax();
+        if (builder.getScheme() == null) {
+            builder.setScheme(URIScheme.HTTP.id);
         }
         if (builder.isPathEmpty()) {
             builder.setPathSegments("");
         }
-        if (builder.getScheme() != null) {
-            builder.setScheme(builder.getScheme().toLowerCase(Locale.ROOT));
-        }
-        if (builder.getHost() != null) {
-            builder.setHost(builder.getHost().toLowerCase(Locale.ROOT));
-        }
         return builder.build();
     }
 
diff --git a/httpclient5/src/test/java/org/apache/hc/client5/http/utils/TestURIUtils.java b/httpclient5/src/test/java/org/apache/hc/client5/http/utils/TestURIUtils.java
index b82e99b..2d8e09a 100644
--- a/httpclient5/src/test/java/org/apache/hc/client5/http/utils/TestURIUtils.java
+++ b/httpclient5/src/test/java/org/apache/hc/client5/http/utils/TestURIUtils.java
@@ -163,13 +163,13 @@ public class TestURIUtils {
                 .toString());
         Assert.assertEquals("http://a/b/c/y", URIUtils.resolve(this.baseURI, "g;x=1/../y")
                 .toString());
-        Assert.assertEquals("http://a/b/c/g?y/./x", URIUtils.resolve(this.baseURI, "g?y/./x")
+        Assert.assertEquals("http://a/b/c/g?y%2F.%2Fx", URIUtils.resolve(this.baseURI, "g?y/./x")
                 .toString());
-        Assert.assertEquals("http://a/b/c/g?y/../x", URIUtils.resolve(this.baseURI, "g?y/../x")
+        Assert.assertEquals("http://a/b/c/g?y%2F..%2Fx", URIUtils.resolve(this.baseURI, "g?y/../x")
                 .toString());
-        Assert.assertEquals("http://a/b/c/g#s/./x", URIUtils.resolve(this.baseURI, "g#s/./x")
+        Assert.assertEquals("http://a/b/c/g#s%2F.%2Fx", URIUtils.resolve(this.baseURI, "g#s/./x")
                 .toString());
-        Assert.assertEquals("http://a/b/c/g#s/../x", URIUtils.resolve(this.baseURI, "g#s/../x")
+        Assert.assertEquals("http://a/b/c/g#s%2F..%2Fx", URIUtils.resolve(this.baseURI, "g#s/../x")
                 .toString());
         Assert.assertEquals("http:g", URIUtils.resolve(this.baseURI, "http:g").toString());
         // examples from section 5.2.4


[httpcomponents-client] 01/03: Upgraded HttpCore to version 5.1-beta3

Posted by ol...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

olegk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/httpcomponents-client.git

commit 004bc85934f4410fc89a7b5b4ee531444c14b827
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Fri Feb 5 22:24:08 2021 +0100

    Upgraded HttpCore to version 5.1-beta3
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index bb791d7..758aed1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -62,7 +62,7 @@
   <properties>
     <maven.compiler.source>1.7</maven.compiler.source>
     <maven.compiler.target>1.7</maven.compiler.target>
-    <httpcore.version>5.1-beta2</httpcore.version>
+    <httpcore.version>5.1-beta3</httpcore.version>
     <log4j.version>2.9.1</log4j.version>
     <commons-codec.version>1.13</commons-codec.version>
     <conscrypt.version>2.2.1</conscrypt.version>