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
4d20083b
Commit
4d20083b
authored
Oct 05, 2016
by
Linus G Thiel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Respond with 404 Not Found for non-existent tags
Non-existent tags should be handled with 404 Not Found.
parent
00f002ed
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
0 deletions
+17
-0
CHANGELOG
CHANGELOG
+1
-0
app/controllers/projects/tags_controller.rb
app/controllers/projects/tags_controller.rb
+2
-0
spec/controllers/projects/tags_controller_spec.rb
spec/controllers/projects/tags_controller_spec.rb
+14
-0
No files found.
CHANGELOG
View file @
4d20083b
Please view this file on the master branch, on stable branches it's out of date.
v 8.12.0 (unreleased)
- Respond with 404 Not Found for non-existent tags
- Update the rouge gem to 2.0.6, which adds highlighting support for JSX, Prometheus, and others. !6251
- Only check :can_resolve permission if the note is resolvable
- Add ability to fork to a specific namespace using API. (ritave)
...
...
app/controllers/projects/tags_controller.rb
View file @
4d20083b
...
...
@@ -20,6 +20,8 @@ class Projects::TagsController < Projects::ApplicationController
def
show
@tag
=
@repository
.
find_tag
(
params
[
:id
])
return
render_404
if
@tag
.
nil?
@release
=
@project
.
releases
.
find_or_initialize_by
(
tag:
@tag
.
name
)
@commit
=
@repository
.
commit
(
@tag
.
target
)
end
...
...
spec/controllers/projects/tags_controller_spec.rb
View file @
4d20083b
...
...
@@ -17,4 +17,18 @@ describe Projects::TagsController do
expect
(
assigns
(
:releases
)).
not_to
include
(
invalid_release
)
end
end
describe
'GET show'
do
before
{
get
:show
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
.
to_param
,
id:
id
}
context
"valid tag"
do
let
(
:id
)
{
'v1.0.0'
}
it
{
is_expected
.
to
respond_with
(
:success
)
}
end
context
"invalid tag"
do
let
(
:id
)
{
'latest'
}
it
{
is_expected
.
to
respond_with
(
:not_found
)
}
end
end
end
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