summaryrefslogtreecommitdiff
path: root/app/validators
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@gitlab.com>2017-04-24 12:38:09 +0200
committerBob Van Landuyt <bob@gitlab.com>2017-05-01 11:14:24 +0200
commit12735eefcd7876435cd05f35a9f26bfe2836e09f (patch)
treea433db37dd74431960817038f86d9ffa8bef9c66 /app/validators
parentea8e86dac856fdf6545e020df346533231379b93 (diff)
downloadgitlab-ce-12735eefcd7876435cd05f35a9f26bfe2836e09f.tar.gz
Minor style adjustments
Diffstat (limited to 'app/validators')
-rw-r--r--app/validators/dynamic_path_validator.rb60
1 files changed, 39 insertions, 21 deletions
diff --git a/app/validators/dynamic_path_validator.rb b/app/validators/dynamic_path_validator.rb
index ae2bd5984c5..5d2d3228baa 100644
--- a/app/validators/dynamic_path_validator.rb
+++ b/app/validators/dynamic_path_validator.rb
@@ -16,20 +16,33 @@ class DynamicPathValidator < ActiveModel::EachValidator
# the path `api` shouldn't be allowed because it would be masked by `api/*`
#
TOP_LEVEL_ROUTES = Set.new(%w[
+ -
.well-known
+ abuse_reports
admin
all
+ api
assets
+ autocomplete
ci
dashboard
+ explore
files
groups
+ health_check
help
hooks
+ import
+ invites
issues
+ jwt
+ koding
+ member
merge_requests
new
notes
+ notification_settings
+ oauth
profile
projects
public
@@ -37,29 +50,14 @@ class DynamicPathValidator < ActiveModel::EachValidator
robots.txt
s
search
+ sent_notifications
services
snippets
teams
u
unsubscribes
- users
- api
- autocomplete
- search
- member
- explore
uploads
- import
- notification_settings
- abuse_reports
- invites
- help
- koding
- health_check
- jwt
- oauth
- sent_notifications
- -
+ users
]).freeze
# All project routes with wildcard argument must be listed here.
@@ -71,10 +69,30 @@ class DynamicPathValidator < 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/lfs/objects
- gitlab-lfs/objects environments/folders])
+ WILDCARD_ROUTES = Set.new(%w[
+ artifacts
+ badges
+ blame
+ blob
+ commits
+ create
+ create_dir
+ edit
+ environments/folders
+ files
+ find_file
+ gitlab-lfs/objects
+ graphs
+ info/lfs/objects
+ logs_tree
+ new
+ preview
+ raw
+ refs
+ tree
+ update
+ wikis
+ ]).freeze
STRICT_RESERVED = (TOP_LEVEL_ROUTES | WILDCARD_ROUTES).freeze