Validate the namespace before looking it up
This will prevent unicode errors when trying to lookup unicode in the database Fixes https://sentry.io/organizations/coreos/issues/628269769/?project=52148
This commit is contained in:
parent
2cebf828a2
commit
166fd671c8
1 changed files with 4 additions and 0 deletions
|
@ -843,6 +843,10 @@ def redirect_to_repository(namespace_name, repo_name, tag_name):
|
|||
@process_oauth
|
||||
@anon_protect
|
||||
def redirect_to_namespace(namespace):
|
||||
okay, _ = model.user.validate_username(namespace)
|
||||
if not okay:
|
||||
abort(404)
|
||||
|
||||
user_or_org = model.user.get_user_or_org(namespace)
|
||||
if not user_or_org:
|
||||
abort(404)
|
||||
|
|
Reference in a new issue