hubsrht: Expect valid canonical name in URLs

This commit is contained in:
Adnan Maolood 2022-09-06 08:42:22 -04:00 committed by Drew DeVault
parent 2f890ff9d3
commit 638a05c8df
1 changed files with 2 additions and 0 deletions

View File

@ -10,6 +10,8 @@ class ProjectAccess(Enum):
def get_project(owner, project_name, access, user=current_user):
if owner.startswith("~"):
owner = owner[1:]
else:
abort(404)
project = (Project.query
.join(User, Project.owner_id == User.id)
.filter(User.username == owner)