From 5949f398f71d9cb540e42988c19fac2768c92eb8 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 21 Nov 2016 21:03:18 +0200 Subject: Fix 500 error when group name ends with git Signed-off-by: Dmitriy Zaporozhets --- changelogs/unreleased/dz-fix-500-group-git.yml | 4 ++++ lib/gitlab/regex.rb | 2 +- spec/routing/routing_spec.rb | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 changelogs/unreleased/dz-fix-500-group-git.yml diff --git a/changelogs/unreleased/dz-fix-500-group-git.yml b/changelogs/unreleased/dz-fix-500-group-git.yml new file mode 100644 index 00000000000..38e80ad8bde --- /dev/null +++ b/changelogs/unreleased/dz-fix-500-group-git.yml @@ -0,0 +1,4 @@ +--- +title: Fix 500 error when group name ends with git +merge_request: 7630 +author: diff --git a/lib/gitlab/regex.rb b/lib/gitlab/regex.rb index 47ea8b7e82e..c12358ceef4 100644 --- a/lib/gitlab/regex.rb +++ b/lib/gitlab/regex.rb @@ -9,7 +9,7 @@ module Gitlab # `NAMESPACE_REGEX_STR`, with the negative lookbehind assertion removed. This means that the client-side validation # will pass for usernames ending in `.atom` and `.git`, but will be caught by the server-side validation. NAMESPACE_REGEX_STR_SIMPLE = '[a-zA-Z0-9_\.][a-zA-Z0-9_\-\.]*[a-zA-Z0-9_\-]|[a-zA-Z0-9_]'.freeze - NAMESPACE_REGEX_STR = "(?:#{NAMESPACE_REGEX_STR_SIMPLE})(?