reg icon indicating copy to clipboard operation
reg copied to clipboard

change Ping to check for Docker header

Open jabielecki opened this issue 6 years ago • 0 comments

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

jabielecki avatar Nov 20 '19 15:11 jabielecki