You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by gg...@apache.org on 2018/10/03 15:28:31 UTC

httpcomponents-core git commit: Reuse our UriScheme enum instead of magic strings.

Repository: httpcomponents-core
Updated Branches:
  refs/heads/master e6bf05ca8 -> c1f141806


Reuse our UriScheme enum instead of magic strings.

Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/c1f14180
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/c1f14180
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/c1f14180

Branch: refs/heads/master
Commit: c1f14180634339d23a76a786bb590b85dfa86694
Parents: e6bf05c
Author: Gary Gregory <gg...@rocketsoftware.com>
Authored: Wed Oct 3 09:28:29 2018 -0600
Committer: Gary Gregory <gg...@rocketsoftware.com>
Committed: Wed Oct 3 09:28:29 2018 -0600

----------------------------------------------------------------------
 .../java/org/apache/hc/core5/http/message/BasicHttpRequest.java   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/c1f14180/httpcore5/src/main/java/org/apache/hc/core5/http/message/BasicHttpRequest.java
----------------------------------------------------------------------
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/message/BasicHttpRequest.java b/httpcore5/src/main/java/org/apache/hc/core5/http/message/BasicHttpRequest.java
index d530e84..811a99c 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/message/BasicHttpRequest.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/message/BasicHttpRequest.java
@@ -33,6 +33,7 @@ import java.net.URISyntaxException;
 import org.apache.hc.core5.http.HttpHost;
 import org.apache.hc.core5.http.HttpRequest;
 import org.apache.hc.core5.http.ProtocolVersion;
+import org.apache.hc.core5.http.URIScheme;
 import org.apache.hc.core5.net.URIAuthority;
 import org.apache.hc.core5.util.Args;
 import org.apache.hc.core5.util.TextUtils;
@@ -192,7 +193,7 @@ public class BasicHttpRequest extends HeaderGroup implements HttpRequest {
         if (this.requestUri == null) {
             final StringBuilder buf = new StringBuilder();
             if (this.authority != null) {
-                buf.append(this.scheme != null ? this.scheme : "http").append("://");
+                buf.append(this.scheme != null ? this.scheme : URIScheme.HTTP.id).append("://");
                 buf.append(this.authority.getHostName());
                 if (this.authority.getPort() >= 0) {
                     buf.append(":").append(this.authority.getPort());