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
Tatuya Kamada
gitlab-ce
Commits
c48f7153
Commit
c48f7153
authored
Oct 16, 2016
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix 404 when group path has dot in the name
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
59fd4555
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
config/routes/group.rb
config/routes/group.rb
+4
-1
spec/routing/routing_spec.rb
spec/routing/routing_spec.rb
+6
-0
No files found.
config/routes/group.rb
View file @
c48f7153
require
'constraints/group_url_constrainer'
constraints
(
GroupUrlConstrainer
.
new
)
do
scope
(
path:
':id'
,
as: :group
,
controller: :groups
)
do
scope
(
path:
':id'
,
as: :group
,
constraints:
{
id:
/[a-zA-Z.0-9_\-]+(?<!\.atom)/
},
controller: :groups
)
do
get
'/'
,
action: :show
patch
'/'
,
action: :update
put
'/'
,
action: :update
...
...
spec/routing/routing_spec.rb
View file @
c48f7153
...
...
@@ -270,6 +270,12 @@ describe "Groups", "routing" do
expect
(
get
(
'/1'
)).
to
route_to
(
'groups#show'
,
id:
'1'
)
end
it
"also display group#show with dot in the path"
do
allow
(
Group
).
to
receive
(
:find_by_path
).
and_return
(
true
)
expect
(
get
(
'/group.with.dot'
)).
to
route_to
(
'groups#show'
,
id:
'group.with.dot'
)
end
end
describe
HealthCheckController
,
'routing'
do
...
...
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