Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2017-10-19 02:35:37 +0300
committerStan Hu <stanhu@gmail.com>2017-10-19 05:38:12 +0300
commitb7e3503372e0043ed6e0185b6546043457173bc8 (patch)
tree98e0357162b52171ae6fd27d1cc6e21058edf2d0 /config/routes
parent9c71fb0de2f0a7482b1a59c673142981ecdab26f (diff)
Fix inability to delete container registry tags
Because container registry tags can have periods, the addition of the `.json` format caused ambiguity. Since the tag name regex is greedy, it would attempt to locate an image named `foo.json` instead of `foo`. Closes #39260
Diffstat (limited to 'config/routes')
-rw-r--r--config/routes/project.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/config/routes/project.rb b/config/routes/project.rb
index 7f0e056c884..d05fe11f233 100644
--- a/config/routes/project.rb
+++ b/config/routes/project.rb
@@ -281,8 +281,13 @@ constraints(ProjectUrlConstrainer.new) do
namespace :registry do
resources :repository, only: [] do
- resources :tags, only: [:index, :destroy],
- constraints: { id: Gitlab::Regex.container_registry_tag_regex }
+ # We default to JSON format in the controller to avoid ambiguity.
+ # `latest.json` could either be a request for a tag named `latest`
+ # in JSON format, or a request for tag named `latest.json`.
+ scope format: false do
+ resources :tags, only: [:index, :destroy],
+ constraints: { id: Gitlab::Regex.container_registry_tag_regex }
+ end
end
end