Commit e104ba6c authored by Grzegorz Bizon's avatar Grzegorz Bizon

Merge branch '224470-mixed-case-pages-url' into 'master'

Fix pages_url for mixed case paths

See merge request gitlab-org/gitlab!35300
parents 0f6f3f2b 81bd2358
...@@ -1703,7 +1703,7 @@ class Project < ApplicationRecord ...@@ -1703,7 +1703,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}"
......
---
title: Fix pages_url for projects with mixed case path
merge_request: 35300
author:
type: fixed
...@@ -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
......
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