You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by al...@apache.org on 2022/07/11 08:13:53 UTC

[dubbo-spi-extensions] branch master updated: fix set protocol (#124)

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

albumenj pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-spi-extensions.git


The following commit(s) were added to refs/heads/master by this push:
     new d426d98  fix set protocol (#124)
d426d98 is described below

commit d426d98cf4f4bf92255ab157044c8604e307ac41
Author: Albumen Kevin <jh...@gmail.com>
AuthorDate: Mon Jul 11 16:13:48 2022 +0800

    fix set protocol (#124)
---
 .../main/java/org/apache/dubbo/rpc/protocol/http/HttpProtocol.java    | 2 +-
 .../org/apache/dubbo/rpc/protocol/webservice/WebServiceProtocol.java  | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/dubbo-rpc-extensions/dubbo-rpc-http/src/main/java/org/apache/dubbo/rpc/protocol/http/HttpProtocol.java b/dubbo-rpc-extensions/dubbo-rpc-http/src/main/java/org/apache/dubbo/rpc/protocol/http/HttpProtocol.java
index ea17894..6bb5569 100644
--- a/dubbo-rpc-extensions/dubbo-rpc-http/src/main/java/org/apache/dubbo/rpc/protocol/http/HttpProtocol.java
+++ b/dubbo-rpc-extensions/dubbo-rpc-http/src/main/java/org/apache/dubbo/rpc/protocol/http/HttpProtocol.java
@@ -140,7 +140,7 @@ public class HttpProtocol extends AbstractProxyProtocol {
             }
             return invocation;
         });
-        String key = url.toIdentityString();
+        String key = new URL("http", url.getHost(), url.getPort(), url.getPath(), url.getParameters()).toIdentityString();
         if (isGeneric) {
             key = key + "/" + GENERIC_KEY;
         }
diff --git a/dubbo-rpc-extensions/dubbo-rpc-webservice/src/main/java/org/apache/dubbo/rpc/protocol/webservice/WebServiceProtocol.java b/dubbo-rpc-extensions/dubbo-rpc-webservice/src/main/java/org/apache/dubbo/rpc/protocol/webservice/WebServiceProtocol.java
index d961747..f47cdc2 100644
--- a/dubbo-rpc-extensions/dubbo-rpc-webservice/src/main/java/org/apache/dubbo/rpc/protocol/webservice/WebServiceProtocol.java
+++ b/dubbo-rpc-extensions/dubbo-rpc-webservice/src/main/java/org/apache/dubbo/rpc/protocol/webservice/WebServiceProtocol.java
@@ -139,7 +139,9 @@ public class WebServiceProtocol extends AbstractProxyProtocol {
         if (!StringUtils.isEmpty(servicePathPrefix) && PROTOCOL_SERVER_SERVLET.equals(url.getParameter(PROTOCOL_SERVER))) {
             url = url.setPath(servicePathPrefix + "/" + url.getPath());
         }
-        proxyFactoryBean.setAddress(url.setProtocol("http").toIdentityString());
+        String key = new URL("http", url.getHost(), url.getPort(), url.getPath(), url.getParameters()).toIdentityString();
+
+        proxyFactoryBean.setAddress(key);
         proxyFactoryBean.setServiceClass(serviceType);
         proxyFactoryBean.setBus(bus);
         T ref = (T) proxyFactoryBean.create();