Commit 81bd2358 authored by Krasimir Angelov's avatar Krasimir Angelov

Fix pages_url for mixed case paths

Related to https://gitlab.com/gitlab-org/gitlab/-/issues/224470.
parent d7c0fba9
......@@ -1699,7 +1699,7 @@ class Project < ApplicationRecord
def pages_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
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
let(:project_name) { '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
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