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
8ab347b3
Commit
8ab347b3
authored
Mar 20, 2017
by
Adam Niedzielski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return 404 in project issues API endpoint when project cannot be found
Closes #29631
parent
a1a04828
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
2 deletions
+18
-2
changelogs/unreleased/api-project-issues-404.yml
changelogs/unreleased/api-project-issues-404.yml
+4
-0
lib/api/issues.rb
lib/api/issues.rb
+1
-1
lib/api/v3/issues.rb
lib/api/v3/issues.rb
+1
-1
spec/requests/api/issues_spec.rb
spec/requests/api/issues_spec.rb
+6
-0
spec/requests/api/v3/issues_spec.rb
spec/requests/api/v3/issues_spec.rb
+6
-0
No files found.
changelogs/unreleased/api-project-issues-404.yml
0 → 100644
View file @
8ab347b3
---
title
:
Return 404 in project issues API endpoint when project cannot be found
merge_request
:
10093
author
:
lib/api/issues.rb
View file @
8ab347b3
...
@@ -91,7 +91,7 @@ module API
...
@@ -91,7 +91,7 @@ module API
use
:issues_params
use
:issues_params
end
end
get
":id/issues"
do
get
":id/issues"
do
project
=
find_project
(
params
[
:id
])
project
=
find_project
!
(
params
[
:id
])
issues
=
find_issues
(
project_id:
project
.
id
)
issues
=
find_issues
(
project_id:
project
.
id
)
...
...
lib/api/v3/issues.rb
View file @
8ab347b3
...
@@ -103,7 +103,7 @@ module API
...
@@ -103,7 +103,7 @@ module API
use
:issues_params
use
:issues_params
end
end
get
":id/issues"
do
get
":id/issues"
do
project
=
find_project
(
params
[
:id
])
project
=
find_project
!
(
params
[
:id
])
issues
=
find_issues
(
project_id:
project
.
id
)
issues
=
find_issues
(
project_id:
project
.
id
)
...
...
spec/requests/api/issues_spec.rb
View file @
8ab347b3
...
@@ -534,6 +534,12 @@ describe API::Issues, api: true do
...
@@ -534,6 +534,12 @@ describe API::Issues, api: true do
describe
"GET /projects/:id/issues"
do
describe
"GET /projects/:id/issues"
do
let
(
:base_url
)
{
"/projects/
#{
project
.
id
}
"
}
let
(
:base_url
)
{
"/projects/
#{
project
.
id
}
"
}
it
'returns 404 when project does not exist'
do
get
api
(
'/projects/1000/issues'
,
non_member
)
expect
(
response
).
to
have_http_status
(
404
)
end
it
"returns 404 on private projects for other users"
do
it
"returns 404 on private projects for other users"
do
private_project
=
create
(
:empty_project
,
:private
)
private_project
=
create
(
:empty_project
,
:private
)
create
(
:issue
,
project:
private_project
)
create
(
:issue
,
project:
private_project
)
...
...
spec/requests/api/v3/issues_spec.rb
View file @
8ab347b3
...
@@ -439,6 +439,12 @@ describe API::V3::Issues, api: true do
...
@@ -439,6 +439,12 @@ describe API::V3::Issues, api: true do
describe
"GET /projects/:id/issues"
do
describe
"GET /projects/:id/issues"
do
let
(
:base_url
)
{
"/projects/
#{
project
.
id
}
"
}
let
(
:base_url
)
{
"/projects/
#{
project
.
id
}
"
}
it
'returns 404 when project does not exist'
do
get
v3_api
(
'/projects/1000/issues'
,
non_member
)
expect
(
response
).
to
have_http_status
(
404
)
end
it
"returns 404 on private projects for other users"
do
it
"returns 404 on private projects for other users"
do
private_project
=
create
(
:empty_project
,
:private
)
private_project
=
create
(
:empty_project
,
:private
)
create
(
:issue
,
project:
private_project
)
create
(
:issue
,
project:
private_project
)
...
...
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