Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-05-20 03:46:40 +0300
committerDouwe Maan <douwe@selenight.nl>2017-05-24 04:38:24 +0300
commit4345bb8c507a11af694617187dea14284f48fb96 (patch)
tree20bc96bf6f90f8654492fb4e8b5cb1108e3d131d /lib/constraints/group_url_constrainer.rb
parent3cfcbcf35badfdb21244f7f16c8640cd83b49205 (diff)
Fix ambiguous routing issues by teaching router about reserved words
Diffstat (limited to 'lib/constraints/group_url_constrainer.rb')
-rw-r--r--lib/constraints/group_url_constrainer.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/constraints/group_url_constrainer.rb b/lib/constraints/group_url_constrainer.rb
index 5f379756c11..6fc1d56d7a0 100644
--- a/lib/constraints/group_url_constrainer.rb
+++ b/lib/constraints/group_url_constrainer.rb
@@ -1,9 +1,9 @@
class GroupUrlConstrainer
def matches?(request)
- id = request.params[:id]
+ full_path = request.params[:group_id] || request.params[:id]
- return false unless DynamicPathValidator.valid?(id)
+ return false unless DynamicPathValidator.valid_group_path?(full_path)
- Group.find_by_full_path(id, follow_redirects: request.get?).present?
+ Group.find_by_full_path(full_path, follow_redirects: request.get?).present?
end
end