Skip to content
2 changes: 1 addition & 1 deletion src/gitingest/parse_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def _parse_url(url: str) -> dict[str, Any]:
url = url.split(" ")[0]
url = unquote(url) # Decode URL-encoded characters

if not url.startswith("https://"):
if not url.startswith(("https://", "http://")):
url = "https://" + url

# Extract domain and path
Expand Down
1 change: 1 addition & 0 deletions src/gitingest/tests/test_parse_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ def test_parse_url_valid() -> None:
"https://github.com/user/repo",
"https://gitlab.com/user/repo",
"https://bitbucket.org/user/repo",
"http://github.com/user/repo",
]
for url in test_cases:
result = _parse_url(url)
Expand Down
Loading