The existing code returns incorrect href= in the root document (aka
"version" document) if the default configuration is used. If a remote
system accesses Glance API, the netspec of href= contains 0.0.0.0,
which cannot be used for further remote accesses. This happens because
attempts to use local configuration or the bind address to reconstruct
URLs are futile.

The correct way resolve this problem is to use the Host: header
of the HTTP request. As a bonus, it works with IPv6, should we ever
support it.