Commit 4754123e authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'rs-blacklist-well-known' into 'master'

Add '.well-known' to the list of reserved namespaces

See https://gitlab.com/gitlab-org/gitlab-ce/issues/22759

See merge request !6585
parents dbfcccaf d75a8297
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
# Values are checked for formatting and exclusion from a list of reserved path # Values are checked for formatting and exclusion from a list of reserved path
# names. # names.
class NamespaceValidator < ActiveModel::EachValidator class NamespaceValidator < ActiveModel::EachValidator
RESERVED = %w( RESERVED = %w[
.well-known
admin admin
all all
assets assets
...@@ -31,7 +32,7 @@ class NamespaceValidator < ActiveModel::EachValidator ...@@ -31,7 +32,7 @@ class NamespaceValidator < ActiveModel::EachValidator
u u
unsubscribes unsubscribes
users users
).freeze ].freeze
def validate_each(record, attribute, value) def validate_each(record, attribute, value)
unless value =~ Gitlab::Regex.namespace_regex unless value =~ Gitlab::Regex.namespace_regex
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment