diff options
author | Bob Van Landuyt <bob@gitlab.com> | 2017-04-10 20:27:19 +0300 |
---|---|---|
committer | Bob Van Landuyt <bob@gitlab.com> | 2017-05-01 12:14:24 +0300 |
commit | e4f5b7ca2184473985ef216df676ddb737fb26af (patch) | |
tree | 3973c48d6a67f4473bdced644dfdd0b026835ad4 /app/validators | |
parent | 74fcccaab30ac0f9e11ed9a076c008ade13a50d0 (diff) |
Improve detection of reserved words from routes
Diffstat (limited to 'app/validators')
-rw-r--r-- | app/validators/namespace_validator.rb | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/app/validators/namespace_validator.rb b/app/validators/namespace_validator.rb index 5a8b482d3db..4d99b09e98f 100644 --- a/app/validators/namespace_validator.rb +++ b/app/validators/namespace_validator.rb @@ -69,21 +69,10 @@ class NamespaceValidator < ActiveModel::EachValidator # without tree as reserved name routing can match 'group/project' as group name, # 'tree' as project name and 'deploy_keys' as route. # + WILDCARD_ROUTES = Set.new(%w[tree commits wikis new edit create update logs_tree preview blob blame raw files create_dir find_file - artifacts graphs refs badges info git-upload-pack - git-receive-pack gitlab-lfs autocomplete_sources - templates avatar commit pages compare network snippets - services mattermost deploy_keys forks import merge_requests - branches merged_branches tags protected_branches variables - triggers pipelines environments cycle_analytics builds - hooks container_registry milestones labels issues - project_members group_links notes noteable boards todos - uploads runners runner_projects settings repository - transfer remove_fork archive unarchive housekeeping - toggle_star preview_markdown export remove_export - generate_new_export download_export activity - new_issue_address registry]) + artifacts graphs refs badges objects folders file]) STRICT_RESERVED = (TOP_LEVEL_ROUTES | WILDCARD_ROUTES) |