Skip to content

When namespace_in_path is enabled and the host URL is duplicated in the URL path, the user is redirected to a malformed URL

Summary

namespace_in_path is enabled: When the host URL is duplicated in the URL path and the URL doesn't end with a forward slash (/), the user is redirected to a malformed URL, leading to a 404 error.

  • Pages URL: http://35.202.13.182.nip.io/public-group/proj.35.202.13.182.nip.io
  • Redirected to: http://35.202.13.182.nip.io/public-group.35.202.13.182.nip.io/proj/
  • Expected redirect: http://35.202.13.182.nip.io/public-group/proj.35.202.13.182.nip.io/

Related to: #434372 (comment 1758875384)

Steps to reproduce

Example Project

What is the current bug behavior?

What is the expected correct behavior?

Relevant logs and/or screenshots

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of: \`sudo gitlab-rake gitlab:env:info\`) (For installations from source run and paste the output of: \`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production\`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:check SANITIZE=true`)

(For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true`)

(we will only investigate if the tests are passing)

Possible fixes

Edited by Naman Jagdish Gala