Skip to content

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

Krasimir Angelov requested to merge 226874-fix-pages-url-path into master

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

Availability and Testing

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

Merge request reports