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.git
The following commit(s) were added to refs/heads/master by this push:
new 55eb51a fix url was truncated expectedly (#7716)
55eb51a is described below
commit 55eb51ab21b270d9cd623842674e9eb479257c72
Author: Wu Zhiguo <[email protected]>
AuthorDate: Tue May 11 10:51:59 2021 +0800
fix url was truncated expectedly (#7716)
---
dubbo-common/src/main/java/org/apache/dubbo/common/URL.java | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/dubbo-common/src/main/java/org/apache/dubbo/common/URL.java
b/dubbo-common/src/main/java/org/apache/dubbo/common/URL.java
index 834ee88..5d92879 100644
--- a/dubbo-common/src/main/java/org/apache/dubbo/common/URL.java
+++ b/dubbo-common/src/main/java/org/apache/dubbo/common/URL.java
@@ -246,11 +246,6 @@ class URL implements Serializable {
int port = 0;
String path = null;
Map<String, String> parameters = null;
- // ignore the url content following '#'
- int poundIndex = url.indexOf('#');
- if (poundIndex != -1) {
- url = url.substring(0, poundIndex);
- }
int i = url.indexOf('?'); // separator between body and parameters
if (i >= 0) {
String[] parts = url.substring(i + 1).split("&");
@@ -274,6 +269,13 @@ class URL implements Serializable {
}
url = url.substring(0, i);
}
+
+ // ignore the url content following '#'
+ int poundIndex = url.indexOf('#');
+ if (poundIndex != -1) {
+ url = url.substring(0, poundIndex);
+ }
+
i = url.indexOf("://");
if (i >= 0) {
if (i == 0) {