Skip to content

Commit bb4768d

Browse files
committed
fix: forbid .git suffixes within repository URLs during submission validation
1 parent 4732750 commit bb4768d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎validate_submission.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,9 @@ def repository_parts(url: str) -> tuple[str, str]:
153153
parts = parsed.path.strip("/").split("/")
154154
if len(parts) != 2 or not all(parts):
155155
raise ValidationError(f"repository URL must identify an owner and repository: {url}")
156-
return parts[0], parts[1].removesuffix(".git")
156+
if parts[1].endswith(".git"):
157+
raise ValidationError(f"repository URL must not use a .git suffix: {url}")
158+
return parts[0], parts[1]
157159

158160

159161
def validate_repository(plugin_id: str, entry: dict, changed: set[str]) -> None:

0 commit comments

Comments
 (0)