forked from TrueCloudLab/distribution
Disambiguate routing for multi-level repository names
To be able to support multi-level repository names, the API has been adjusted to disabiguate routes tagged image manifest routes and tag list routes. With this effort, the regular expressions have been defined in a single place to reduce repitition and ensure that validation is consistent across the registry. The router was also refactored to remove the use of subrouters, simplifying the route definition code. This also reduces the number of regular expression match checks during the routing process.
This commit is contained in:
parent
375f3cc136
commit
145c89bb94
3 changed files with 90 additions and 75 deletions
|
@ -87,21 +87,21 @@ func TestAppDispatcher(t *testing.T) {
|
|||
endpoint: routeNameLayer,
|
||||
vars: []string{
|
||||
"name", "foo/bar",
|
||||
"tarsum", "thetarsum",
|
||||
"tarsum", "tarsum.v1+bogus:abcdef0123456789",
|
||||
},
|
||||
},
|
||||
{
|
||||
endpoint: routeNameLayerUpload,
|
||||
vars: []string{
|
||||
"name", "foo/bar",
|
||||
"tarsum", "thetarsum",
|
||||
"tarsum", "tarsum.v1+bogus:abcdef0123456789",
|
||||
},
|
||||
},
|
||||
{
|
||||
endpoint: routeNameLayerUploadResume,
|
||||
vars: []string{
|
||||
"name", "foo/bar",
|
||||
"tarsum", "thetarsum",
|
||||
"tarsum", "tarsum.v1+bogus:abcdef0123456789",
|
||||
"uuid", "theuuid",
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue