reg
reg copied to clipboard
change Ping to check for Docker header
Change Registry.Ping() to:
- respect http 401 response code as valid
- conform to the Specs by requiring header Docker-Distribution-API-Version
Change the TokenTransport unit tests to emit that header.
Remove the naive workaround inside Registry.Pingable() as iterating over all sites that do not support the old ping would require huge and constant effort. (Not only GCR.)
I add separate Registry.PingClient, because the Client handles 401 by closing the body so it disables the possibility of disinguishing whether the 401 contained Docker-Distribution-API-Version header.
Refactor: simplify current TestPingable
Closes #198