Remove relative_url_root from path. Fixes #2602
Files and Commits render a 404 when running with relative_url_root.
This commit is contained in:
parent
65737bd5bd
commit
79b9249ff4
2 changed files with 25 additions and 0 deletions
|
@ -50,6 +50,8 @@ module ExtractsPath
|
|||
|
||||
return pair unless @project
|
||||
|
||||
# Remove relative_url_root from path
|
||||
input.gsub!(/^#{Gitlab.config.gitlab.relative_url_root}/, "")
|
||||
# Remove project, actions and all other staff from path
|
||||
input.gsub!(/^\/#{Regexp.escape(@project.path_with_namespace)}/, "")
|
||||
input.gsub!(/^\/(tree|commits|blame|blob|refs)\//, "") # remove actions
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue