Fix Project#pages_url not to downcase url path for project level pages
What does this MR do?
With !35300 (merged) we fixed how we handle group root pages with mixed case path, but the fix broke how we generate #pages_url
for project level pages with mixed case.
This MR updates Project#pages_url
so that we downcase only when comparing with #pages_group_url
and retrun the original url path if the project is not group root Pages project.
The fix is basically
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
Related to #226874 (closed).
Screenshots
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Edited by Jason Goodman