@@ -61,9 +61,6 @@ public static interface CustomNameResolver {
61
61
}
62
62
63
63
public void addCustomNameResolver (String name , CustomNameResolver customNameResolver ) {
64
- if (!(name .startsWith ("#" ) && name .endsWith ("#" ))) {
65
- name = "#" + name + "#" ;
66
- }
67
64
customNameResolvers = MapBuilder .<String , CustomNameResolver >newMapBuilder ().putAll (customNameResolvers ).put (name , customNameResolver ).immutableMap ();
68
65
}
69
66
@@ -73,7 +70,7 @@ public InetAddress resolveBindHostAddress(String bindHost) throws IOException {
73
70
}
74
71
75
72
public InetAddress resolveBindHostAddress (String bindHost , String defaultValue2 ) throws IOException {
76
- return resolveInetAddress (bindHost , settings .get (settings . get ( GLOBAL_NETWORK_BINDHOST_SETTING ) , settings .get (GLOBAL_NETWORK_HOST_SETTING )), defaultValue2 );
73
+ return resolveInetAddress (bindHost , settings .get (GLOBAL_NETWORK_BINDHOST_SETTING , settings .get (GLOBAL_NETWORK_HOST_SETTING )), defaultValue2 );
77
74
}
78
75
79
76
public InetAddress resolvePublishHostAddress (String publishHost ) throws IOException {
@@ -92,7 +89,7 @@ public InetAddress resolvePublishHostAddress(String publishHost) throws IOExcept
92
89
}
93
90
94
91
public InetAddress resolvePublishHostAddress (String publishHost , String defaultValue2 ) throws IOException {
95
- return resolveInetAddress (publishHost , settings .get (settings . get ( GLOBAL_NETWORK_PUBLISHHOST_SETTING ) , settings .get (GLOBAL_NETWORK_HOST_SETTING )), defaultValue2 );
92
+ return resolveInetAddress (publishHost , settings .get (GLOBAL_NETWORK_PUBLISHHOST_SETTING , settings .get (GLOBAL_NETWORK_HOST_SETTING )), defaultValue2 );
96
93
}
97
94
98
95
public InetAddress resolveInetAddress (String host , String defaultValue1 , String defaultValue2 ) throws UnknownHostException , IOException {
@@ -105,7 +102,7 @@ public InetAddress resolveInetAddress(String host, String defaultValue1, String
105
102
if (host == null ) {
106
103
return null ;
107
104
}
108
- if (host .startsWith ("#" ) && host .endsWith ("#" )) {
105
+ if (( host .startsWith ("#" ) && host .endsWith ("#" )) || ( host . startsWith ( "_" ) && host . endsWith ( "_" ) )) {
109
106
host = host .substring (1 , host .length () - 1 );
110
107
111
108
CustomNameResolver customNameResolver = customNameResolvers .get (host );
0 commit comments