Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
f3de7855
Commit
f3de7855
authored
Aug 15, 2019
by
Giorgenes Gelatti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Limit registry tag bulk delete to 15 items
parent
128a04ef
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
app/controllers/projects/registry/tags_controller.rb
app/controllers/projects/registry/tags_controller.rb
+10
-2
No files found.
app/controllers/projects/registry/tags_controller.rb
View file @
f3de7855
...
...
@@ -5,6 +5,8 @@ module Projects
class
TagsController
<
::
Projects
::
Registry
::
ApplicationController
before_action
:authorize_destroy_container_image!
,
only:
[
:destroy
]
LIMIT
=
15
def
index
respond_to
do
|
format
|
format
.
json
do
...
...
@@ -34,7 +36,13 @@ module Projects
return
end
@tags
=
(
params
[
:ids
]
||
[]).
map
{
|
tag_name
|
image
.
tag
(
tag_name
)
}
tag_names
=
params
[
:ids
]
||
[]
if
tag_names
.
size
>
LIMIT
head
:bad_request
return
end
@tags
=
tag_names
.
map
{
|
tag_name
|
image
.
tag
(
tag_name
)
}
unless
@tags
.
all?
{
|
tag
|
tag
.
valid_name?
}
head
:bad_request
return
...
...
@@ -55,7 +63,7 @@ module Projects
private
def
tags
Kaminari
::
PaginatableArray
.
new
(
image
.
tags
,
limit:
15
)
Kaminari
::
PaginatableArray
.
new
(
image
.
tags
,
limit:
LIMIT
)
end
def
image
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment