Skip to content
Snippets Groups Projects
Verified Commit 5949f398 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Fix 500 error when group name ends with git

parent 220c258c
No related branches found
No related tags found
No related merge requests found
---
title: Fix 500 error when group name ends with git
merge_request: 7630
author:
Loading
Loading
@@ -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})(?<!\.git|\.atom)".freeze
NAMESPACE_REGEX_STR = '(?:' + NAMESPACE_REGEX_STR_SIMPLE + ')(?<!\.git|\.atom)'.freeze
 
def namespace_regex
@namespace_regex ||= /\A#{NAMESPACE_REGEX_STR}\z/.freeze
Loading
Loading
Loading
Loading
@@ -261,7 +261,7 @@ describe "Authentication", "routing" do
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)
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment