Closed steveej closed 5 years ago
The original motivation is that specs do not contemplate redirection there: https://docs.docker.com/registry/spec/api/#api-version-check
However I do agree that for a client to be helpful it should be able to handle redirections on most of the paths. Also, all common registries seems to have a redirection in place for HTTP to HTTPS.
IMHO the result of the
is_v2_supported()
method isn't correct as it is. In case of querying a v2-supported registry via plain http, the 301 status code (MOVED) will cause the method to returnfalse
to indicate that v2 is not supported here. The correct behavior would be look at the new URL and if the scheme changed to https, instead of returning false, throw an error which reports that the requested scheme is not supported.I'll go ahead and call this a bug, but I'd like to know the original motivation behind this in case I'm missing something.