BigW Consortium Gitlab

user_url_constrainer.rb 252 Bytes
Newer Older
1 2
class UserUrlConstrainer
  def matches?(request)
3 4
    full_path = request.params[:username]

5
    return false unless NamespacePathValidator.valid_path?(full_path)
6 7

    User.find_by_full_path(full_path, follow_redirects: request.get?).present?
8 9
  end
end