Commit 29b8e564 authored by Shinya Maeda's avatar Shinya Maeda

Merge branch '226874-fix-pages-url-path' into 'master'

Fix Project#pages_url not to downcase url path for project level pages

See merge request gitlab-org/gitlab!36183
parents cbe851e1 d353d350
......@@ -1704,10 +1704,10 @@ class Project < ApplicationRecord
def pages_url
url = pages_group_url
url_path = full_path.partition('/').last.downcase
url_path = full_path.partition('/').last
# 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}".downcase
"#{url}/#{url_path}"
end
......
---
title: Fix Project#pages_url not to downcase url path
merge_request: 36183
author:
type: fixed
......@@ -1666,6 +1666,14 @@ RSpec.describe Project do
let(:project_name) { 'Project' }
it { is_expected.to eq("http://group.example.com/project") }
context 'mixed case path' do
before do
project.update!(path: 'Project')
end
it { is_expected.to eq("http://group.example.com/Project") }
end
end
end
......
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