From 48e4137eba1678c40a4caa92d9148a9ade76ec90 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 18 Dec 2023 16:31:11 -0500 Subject: manifest_xml: do not allow / before : in scp-like syntax Since git doesn't treat these as ssh:// URIs, we shouldn't either. Bug: https://g-issues.gerritcodereview.com/issues/40010331 Change-Id: I001f49be30395187cac447d09cb5a6c29e95768b Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/398517 Tested-by: Mike Frysinger Reviewed-by: Jason Chang Commit-Queue: Mike Frysinger --- manifest_xml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'manifest_xml.py') diff --git a/manifest_xml.py b/manifest_xml.py index edbebaa3..7e533a02 100644 --- a/manifest_xml.py +++ b/manifest_xml.py @@ -134,7 +134,7 @@ def normalize_url(url: str) -> str: parsed_url = urllib.parse.urlparse(url) # This matches patterns like "git@github.com:foo/bar". - scp_like_url_re = r"^[^:]+@[^:]+:[^/]+/" + scp_like_url_re = r"^[^/:]+@[^/:]+:[^/]+/" # If our URL is missing a schema and matches git's # SCP-like syntax we should convert it to a proper -- cgit v1.2.3-54-g00ecf