summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2019-01-15 16:05:09 +0100
committerRobert Schilling <rschilling@student.tugraz.at>2019-01-15 17:16:03 +0100
commit2190704c61323191b581b4776bda450fa5a089b8 (patch)
tree9f14cab22947cc178063da958c44a24a272b2f33 /lib
parentf821a53b45d4b521ffb734b3b843f48e0d1ecfcd (diff)
downloadgitlab-ce-2190704c61323191b581b4776bda450fa5a089b8.tar.gz
API: Support username with dots
Diffstat (limited to 'lib')
-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)