The [ShortUriSerializer]() uses InetAddress.toString() to produce the textual representation of the IP address contained in a UAuthority. In doing so, it assumes that the IP address' hostname is empty and thus toString() yields something like /192.168.1.10, i.e. starts with a slash.
While this assumption is correct for the IP addresses used in UAuthority (which contain no hostname), the usage of the toString() method should better be replaced with getHostAddress() which yields only the textual representation of the IP address' bytes and therefore seems better suited for the purpose of serializing the address to short format.
The [ShortUriSerializer]() uses
InetAddress.toString()
to produce the textual representation of the IP address contained in a UAuthority. In doing so, it assumes that the IP address' hostname is empty and thustoString()
yields something like/192.168.1.10
, i.e. starts with a slash.While this assumption is correct for the IP addresses used in UAuthority (which contain no hostname), the usage of the
toString()
method should better be replaced withgetHostAddress()
which yields only the textual representation of the IP address' bytes and therefore seems better suited for the purpose of serializing the address to short format.