Unverified Commit 5949f398 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Fix 500 error when group name ends with git


Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent a7013a238fe8
---
title: Fix 500 error when group name ends with git
merge_request: 7630
author:
......@@ -9,7 +9,7 @@ module Regex
# `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})(?<!\.git|\.atom)".freeze
NAMESPACE_REGEX_STR = '(?:' + NAMESPACE_REGEX_STR_SIMPLE + ')(?<!\.git|\.atom)'.freeze
def namespace_regex
@namespace_regex ||= /\A#{NAMESPACE_REGEX_STR}\z/.freeze
......
......@@ -261,7 +261,7 @@
end
describe "Groups", "routing" do
let(:name) { 'complex.group-name' }
let(:name) { 'complex.group-namegit' }
it "to #show" do
expect(get("/groups/#{name}")).to route_to('groups#show', id: name)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment