Validate User username only on Namespace, and bubble up appropriately

This commit is contained in:
Douwe Maan
2018-01-31 11:39:03 -06:00
parent 75144b1e03
commit a03d29da1d
12 changed files with 23 additions and 90 deletions

View File

@ -2,7 +2,7 @@ class UserUrlConstrainer
def matches?(request)
full_path = request.params[:username]
return false unless UserPathValidator.valid_path?(full_path)
return false unless NamespacePathValidator.valid_path?(full_path)
User.find_by_full_path(full_path, follow_redirects: request.get?).present?
end