summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/projects.rb2
-rw-r--r--lib/api/users.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb
index 9f3a1699146..d76d5d822b1 100644
--- a/lib/api/projects.rb
+++ b/lib/api/projects.rb
@@ -128,7 +128,7 @@ module API
end
end
- resource :users, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do
+ resource :users, requirements: { user_id: API::NO_SLASH_URL_PART_REGEX } do
desc 'Get a user projects' do
success Entities::BasicProjectDetails
end
diff --git a/lib/api/users.rb b/lib/api/users.rb
index b41fce76df0..ff33e892ef8 100644
--- a/lib/api/users.rb
+++ b/lib/api/users.rb
@@ -135,7 +135,7 @@ module API
params do
requires :id_or_username, type: String, desc: 'The ID or username of the user'
end
- get ":id_or_username/status" do
+ get ":id_or_username/status", requirements: { id_or_username: API::NO_SLASH_URL_PART_REGEX } do
user = find_user(params[:id_or_username])
not_found!('User') unless user && can?(current_user, :read_user, user)