Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
5949f398
Commit
5949f398
authored
Nov 21, 2016
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix 500 error when group name ends with git
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
220c258c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
2 deletions
+6
-2
changelogs/unreleased/dz-fix-500-group-git.yml
changelogs/unreleased/dz-fix-500-group-git.yml
+4
-0
lib/gitlab/regex.rb
lib/gitlab/regex.rb
+1
-1
spec/routing/routing_spec.rb
spec/routing/routing_spec.rb
+1
-1
No files found.
changelogs/unreleased/dz-fix-500-group-git.yml
0 → 100644
View file @
5949f398
---
title
:
Fix 500 error when group name ends with git
merge_request
:
7630
author
:
lib/gitlab/regex.rb
View file @
5949f398
...
@@ -9,7 +9,7 @@ module Gitlab
...
@@ -9,7 +9,7 @@ module Gitlab
# `NAMESPACE_REGEX_STR`, with the negative lookbehind assertion removed. This means that the client-side validation
# `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.
# 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_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
def
namespace_regex
@namespace_regex
||=
/\A
#{
NAMESPACE_REGEX_STR
}
\z/
.
freeze
@namespace_regex
||=
/\A
#{
NAMESPACE_REGEX_STR
}
\z/
.
freeze
...
...
spec/routing/routing_spec.rb
View file @
5949f398
...
@@ -261,7 +261,7 @@ describe "Authentication", "routing" do
...
@@ -261,7 +261,7 @@ describe "Authentication", "routing" do
end
end
describe
"Groups"
,
"routing"
do
describe
"Groups"
,
"routing"
do
let
(
:name
)
{
'complex.group-name'
}
let
(
:name
)
{
'complex.group-name
git
'
}
it
"to #show"
do
it
"to #show"
do
expect
(
get
(
"/groups/
#{
name
}
"
)).
to
route_to
(
'groups#show'
,
id:
name
)
expect
(
get
(
"/groups/
#{
name
}
"
)).
to
route_to
(
'groups#show'
,
id:
name
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment