summaryrefslogtreecommitdiff
path: root/lib/constraints/project_url_constrainer.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-05-19 19:46:40 -0500
committerDouwe Maan <douwe@selenight.nl>2017-05-23 20:38:24 -0500
commit4345bb8c507a11af694617187dea14284f48fb96 (patch)
tree20bc96bf6f90f8654492fb4e8b5cb1108e3d131d /lib/constraints/project_url_constrainer.rb
parent3cfcbcf35badfdb21244f7f16c8640cd83b49205 (diff)
downloadgitlab-ce-4345bb8c507a11af694617187dea14284f48fb96.tar.gz
Fix ambiguous routing issues by teaching router about reserved words
Diffstat (limited to 'lib/constraints/project_url_constrainer.rb')
-rw-r--r--lib/constraints/project_url_constrainer.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/constraints/project_url_constrainer.rb b/lib/constraints/project_url_constrainer.rb
index 6f542f63f98..4c0aee6c48f 100644
--- a/lib/constraints/project_url_constrainer.rb
+++ b/lib/constraints/project_url_constrainer.rb
@@ -2,9 +2,9 @@ class ProjectUrlConstrainer
def matches?(request)
namespace_path = request.params[:namespace_id]
project_path = request.params[:project_id] || request.params[:id]
- full_path = namespace_path + '/' + project_path
+ full_path = [namespace_path, project_path].join('/')
- return false unless DynamicPathValidator.valid?(full_path)
+ return false unless DynamicPathValidator.valid_project_path?(full_path)
Project.find_by_full_path(full_path, follow_redirects: request.get?).present?
end