Skip to content

Commit dd64ba2

Browse files
committed
mypy
1 parent c3803b8 commit dd64ba2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

backend/app/api/repositories.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ async def create_repository(data: RepositoryCreateRequest, db: Session = Depends
2727
if not url:
2828
raise HTTPException(status_code=HTTPStatus.BAD_REQUEST, detail="Missing URL")
2929

30-
if not is_safe_host(urlparse(url).hostname):
30+
hostname = urlparse(url).hostname
31+
if not hostname or not is_safe_host(hostname):
3132
raise HTTPException(status_code=400, detail="URL not allowed")
3233

3334
try:

0 commit comments

Comments
 (0)