2016-11-07 08:16:04 -05:00
|
|
|
class UserUrlConstrainer
|
|
|
|
def matches?(request)
|
2017-05-24 16:59:26 -04:00
|
|
|
full_path = request.params[:username]
|
|
|
|
|
2018-01-31 12:39:03 -05:00
|
|
|
return false unless NamespacePathValidator.valid_path?(full_path)
|
2017-05-24 16:59:26 -04:00
|
|
|
|
|
|
|
User.find_by_full_path(full_path, follow_redirects: request.get?).present?
|
2016-10-06 08:14:24 -04:00
|
|
|
end
|
|
|
|
end
|