summaryrefslogtreecommitdiff
path: root/lib/extracts_path.rb
diff options
context:
space:
mode:
authorJun Futagawa <jfut@integ.jp>2013-01-23 17:29:46 +0900
committerJun Futagawa <jfut@integ.jp>2013-01-23 17:29:46 +0900
commit79b9249ff44c5ccbef44a8d9420a3fff369d932a (patch)
tree89677570a89f846d2291c57fb1abc5b7b5b6206c /lib/extracts_path.rb
parent65737bd5bd6eb65556699a176e69757a3ac8c37a (diff)
downloadgitlab-ce-79b9249ff44c5ccbef44a8d9420a3fff369d932a.tar.gz
Remove relative_url_root from path. Fixes #2602
Files and Commits render a 404 when running with relative_url_root.
Diffstat (limited to 'lib/extracts_path.rb')
-rw-r--r--lib/extracts_path.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/extracts_path.rb b/lib/extracts_path.rb
index 270a0aaa87a..12700e4f4ac 100644
--- a/lib/extracts_path.rb
+++ b/lib/extracts_path.rb
@@ -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