You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by li...@apache.org on 2021/02/23 15:35:27 UTC
[dubbo] branch master updated: ignore '#' when parsing url (#7114)
This is an automated email from the ASF dual-hosted git repository.
liujun 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 d5c0cf8 ignore '#' when parsing url (#7114)
d5c0cf8 is described below
commit d5c0cf82715e15b8064a841d25856b73f243d3cd
Author: ken.lj <ke...@gmail.com>
AuthorDate: Tue Feb 23 23:34:54 2021 +0800
ignore '#' when parsing url (#7114)
---
.../org/apache/dubbo/common/ConfigurationURL.java | 20 --------------------
.../src/main/java/org/apache/dubbo/common/URL.java | 5 +++++
2 files changed, 5 insertions(+), 20 deletions(-)
diff --git a/dubbo-common/src/main/java/org/apache/dubbo/common/ConfigurationURL.java b/dubbo-common/src/main/java/org/apache/dubbo/common/ConfigurationURL.java
deleted file mode 100644
index 2042277..0000000
--- a/dubbo-common/src/main/java/org/apache/dubbo/common/ConfigurationURL.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.dubbo.common;
-
-public class ConfigurationURL extends URL {
-}
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 873f461..86e7a02 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,6 +246,11 @@ 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("&");