summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xgit-bz8
1 files changed, 6 insertions, 2 deletions
diff --git a/git-bz b/git-bz
index 7f9dcf6..0a8f55b 100755
--- a/git-bz
+++ b/git-bz
@@ -405,6 +405,10 @@ class BugHandle:
parseresult = urlparse.urlsplit (bug_reference)
if parseresult.scheme in ('http', 'https'):
+ # Catch http://www.gnome.org and the oddball http:relative/path and http:/path
+ if len(parseresult.path) == 0 or parseresult.path[0] != '/' or parseresult.hostname is None:
+ raise BugParseError("Invalid bug reference '%s'" % bug_reference)
+
user = parseresult.username
pwd = parseresult.password
# if the url did not specify http auth credentials in the form
@@ -417,12 +421,12 @@ class BugHandle:
# strip off everything after the last '/', so '/bugzilla/show_bug.cgi'
# will simply become '/bugzilla'
- path = parseresult.path[:parseresult.path.rfind('/')]
+ base_path = parseresult.path[:parseresult.path.rfind('/')]
m = re.match("id=([^&]+)", parseresult.query)
if m:
return BugHandle(host=parseresult.hostname,
- path=path,
+ path=base_path,
https=parseresult.scheme=="https",
id=m.group(1),
authuser=user,