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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
81bd2358
Commit
81bd2358
authored
Jun 25, 2020
by
Krasimir Angelov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix pages_url for mixed case paths
Related to
https://gitlab.com/gitlab-org/gitlab/-/issues/224470
.
parent
d7c0fba9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
1 deletion
+14
-1
app/models/project.rb
app/models/project.rb
+1
-1
changelogs/unreleased/224470-mixed-case-pages-url.yml
changelogs/unreleased/224470-mixed-case-pages-url.yml
+5
-0
spec/models/project_spec.rb
spec/models/project_spec.rb
+8
-0
No files found.
app/models/project.rb
View file @
81bd2358
...
@@ -1699,7 +1699,7 @@ class Project < ApplicationRecord
...
@@ -1699,7 +1699,7 @@ class Project < ApplicationRecord
def
pages_url
def
pages_url
url
=
pages_group_url
url
=
pages_group_url
url_path
=
full_path
.
partition
(
'/'
).
last
url_path
=
full_path
.
partition
(
'/'
).
last
.
downcase
# If the project path is the same as host, we serve it as group page
# If the project path is the same as host, we serve it as group page
return
url
if
url
==
"
#{
Settings
.
pages
.
protocol
}
://
#{
url_path
}
"
return
url
if
url
==
"
#{
Settings
.
pages
.
protocol
}
://
#{
url_path
}
"
...
...
changelogs/unreleased/224470-mixed-case-pages-url.yml
0 → 100644
View file @
81bd2358
---
title
:
Fix pages_url for projects with mixed case path
merge_request
:
35300
author
:
type
:
fixed
spec/models/project_spec.rb
View file @
81bd2358
...
@@ -1651,6 +1651,14 @@ RSpec.describe Project do
...
@@ -1651,6 +1651,14 @@ RSpec.describe Project do
let
(
:project_name
)
{
'group.example.com'
}
let
(
:project_name
)
{
'group.example.com'
}
it
{
is_expected
.
to
eq
(
"http://group.example.com"
)
}
it
{
is_expected
.
to
eq
(
"http://group.example.com"
)
}
context
'mixed case path'
do
before
do
project
.
update!
(
path:
'Group.example.com'
)
end
it
{
is_expected
.
to
eq
(
"http://group.example.com"
)
}
end
end
end
context
'project page'
do
context
'project page'
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