Skip to content

Commit

Permalink
Fix Metadata Service Info param filter not work (#8402)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbumenJ authored Aug 3, 2021
1 parent 80a38ff commit 94110c0
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,9 @@ public static class ServiceInfo implements Serializable {

private transient URL url;

private final static String[] KEYS_TO_REMOVE = {MONITOR_KEY, BIND_IP_KEY, BIND_PORT_KEY, QOS_ENABLE,
QOS_HOST, QOS_PORT, ACCEPT_FOREIGN_IP, VALIDATION_KEY, INTERFACES, PID_KEY, TIMESTAMP_KEY};

public ServiceInfo() {
}

Expand All @@ -231,11 +234,10 @@ public ServiceInfo(URL url) {
Map<String, String> params = new HashMap<>();
List<MetadataParamsFilter> filters = loader.getActivateExtension(url, "params-filter");
if (filters.size() == 0) {
params.putAll(
url.removeParameters(
MONITOR_KEY, BIND_IP_KEY, BIND_PORT_KEY, QOS_ENABLE,
QOS_HOST, QOS_PORT, ACCEPT_FOREIGN_IP, VALIDATION_KEY, INTERFACES, PID_KEY, TIMESTAMP_KEY)
.getParameters());
params.putAll(url.getParameters());
for (String key : KEYS_TO_REMOVE) {
params.remove(key);
}
}
for (MetadataParamsFilter filter : filters) {
String[] paramsIncluded = filter.serviceParamsIncluded();
Expand Down

0 comments on commit 94110c0

Please sign in to comment.