File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
server/src/main/java/org/elasticsearch/common/network Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change 1919
2020import org .elasticsearch .core .SuppressForbidden ;
2121import org .elasticsearch .core .Tuple ;
22- import org .elasticsearch .xcontent .Text ;
2322import org .elasticsearch .xcontent .XContentString ;
2423
2524import java .net .Inet4Address ;
@@ -434,7 +433,8 @@ private static String hextetsToIPv6String(int[] hextets) {
434433 * @throws IllegalArgumentException if the argument is not a valid IP string literal
435434 */
436435 public static InetAddress forString (String ipString ) {
437- return forString (new Text (ipString ).bytes ());
436+ byte [] utf8Bytes = ipString .getBytes (StandardCharsets .UTF_8 );
437+ return forString (utf8Bytes , 0 , utf8Bytes .length );
438438 }
439439
440440 /**
You can’t perform that action at this time.
0 commit comments