MCPcopy Create free account
hub / github.com/grpc/grpc-java / toUriString

Method toUriString

api/src/main/java/io/grpc/Uri.java:928–938  ·  view source on GitHub ↗
(InetAddress addr)

Source from the content-addressed store, hash-verified

926 }
927
928 private static String toUriString(InetAddress addr) {
929 // InetAddresses.toUriString(addr) is almost enough but neglects RFC 6874 percent encoding.
930 String inetAddrStr = InetAddresses.toUriString(addr);
931 int percentIndex = inetAddrStr.indexOf('%');
932 if (percentIndex < 0) {
933 return inetAddrStr;
934 }
935
936 String scope = inetAddrStr.substring(percentIndex, inetAddrStr.length() - 1);
937 return inetAddrStr.substring(0, percentIndex) + percentEncode(scope, unreservedChars) + "]";
938 }
939
940 @CanIgnoreReturnValue
941 Builder setRawHost(String host) {

Callers 1

setHostMethod · 0.95

Calls 1

percentEncodeMethod · 0.80

Tested by

no test coverage detected